Re: Oaf names & file structure



> Applications should NEVER EVER use IIDS directly. OAF is something which was
> designed precisely so that you do not have to remember to keep them around.

Sometimes you want to use IIDS.  Because I have coded my application
against a specific component, not something that can be plugged. 

> 	  - difficult to type and remember.

The problem is that you still need to use the OAFID in a bunch of
places: in the oafinfo file and in the source code in a number of
spots (to register the factory, to check the instance being
activated).

I could also claim that "oaf_query" has dissadvantages:

	* I do not know how to use it.  I need to read another manual.

	* I need to populate more data in the oaf-file when sometimes,
          I am dealing with a component that is fully internal to me.

> 	  - if someone writes a component to replace your own component
> 	  and want it to be used in the application the original one was used,
> 	  the fact that the code uses the IID directly and not an OAF query
> 	  means that the new component will not be picked up without source code
> 	  hacking.

Lets assume you get two components back A and B from the query.  Now
every time you try to activate a component you should offer the user
an option to select.  That seems excesive and a waste of time.

Why would I need to handle that scenario if I want to activate a
specific implementation?  

> I know that last time I checked Evolution was using IIDs directly and I cannot
> do anything but repeat once more how broken this is: if I write my own
> mail component, I am screwed: it will never be displayed unless I hack the code.

Microsoft COM supports two types of activation, CatID based activation
(similar to the query system in OAF) and implementation-ID based.
CatIDs are only used in a few instances --when it makes sense-- not
everywhere as a rule.

> Using IIDs destroys the whole point of having components with well defined 
> interfaces.

Not at all.  It does defeat replacing random components with other
random components.

For instance, when you launch Internet Explorer, you are not asked 45
times whether you want to use the toolbar A or the toolbar B.  Or if
you want to use IE's HTMl engine, or some other engine.  Some things
are better kept hardcoded.

> However, changing the way OAF uses unique identifiers is:
> 	  1) completely useless since you should not be using those unique identifiers
> 	  in your code.

That is your opinion.  Not everyone writes the code in the same way
you do.

> 	  2) was already discussed months ago from now and we already decided to keep
> 	  with the current convention.

The current convention does suck.

In Windows, the Unique IDs make a bit more sense, because they are
actually integers, and they are used in query interface for doing a
quick compare, and they are used in lots of places for doing quick
comparissions.  

What we have right now is a string, that needs to be strcmped, and
that only happens to be useful for its uniqueness properties, but this
can be achieved in other ways that are more programmer friendly.

Best wishes,
Miguel.




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]