Re: Oaf names & file structure



Everyone is right, stop arguing. :)

It's a bad idea to hard-code IIDs (or AIDs) into your app, because one big
reason for components is being able to replace them. If you want to do
something like embed MSIE, then you could add an 'msielike_rating'
attribute, with the value for MSIE itself being 100, and then do
oaf_activate("", ["msielike_rating"]). If one component is having to
depend on a specific implementation of another component, then perhaps
they should not be components at all...

Realistically though, you are going to have to hard-code IIDs into at
least a few places, and there are some hacks where you might even need to
activate by them. Just note that this is a Bad Thing and To Be Avoided.

Last but not least, please use oaf_activate() rather than oaf_query()
whenever possible. oaf_query() is only necessary when you need to let the
user manually pick from multiple query results - using it as a rule will
result in race conditions.

-- Elliot
"The Pythagorean Theorem employed 24 words, the Lord's Prayer has 66 words,
Archimedes Principle has 67 words, the 10 Commandments have 179 words, the
Gettysburg Address had 286 words, the Declaration of Independence, 1,300 words and
finally the European Commission's regulation on the sale of cabbage: 26,911 words."









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