> I'm SURE over time the model I'm currently using and my
> understanding of OO will improve ... but I don't think it
> will be in this direction. Who knows tho'? I'm a beginner and
> I'm sure I'm in for more surprises as things evolve.
>

Well yeah in the case you provided I guess you could take a "page-out-of" DOM itself, the very hierarchy of objects the browser uses. Each object/element within your dom works independent of one another and the only time a relationship occurs is when an element has children associated to it. That being said either object can look down or up for its parent/child and so the relationship is established but yet independent. Its only bound together by its actual positioning (courtesy of the overall document.root manager itself).

I wonder in DOM how it actually pulls it all together, in that does it take a series of independent objects say "divClass" and "selectBoxClass" and setRelationship(parent) which simply is a runtime reference to the object itself (i.e. all Objects seem to extend one base Object class which has these methods prerolled). As in DOM a nodeObject can't exist without a parent so all objects at some point have parents, but again their logic isn't necessarily dependent on its parent (or children in some cases).

SelectBox & ListBox are one example where a SelectBox needs ListBox otherwise it serves no purpose - yet the ListBox themselves *could* exist independent of the other (i.e.: A SelectBox has a ListBox)

This is where I tend to get confused when applying OO to CFMX in that it try to think like DOM sometimes, an ArticleBO could realistically have a series of internal objects (titleClass, bodyClass etc) which at runtime cannot exist anywhere but within the ArticleBO itself (i.e. ArticleBO is really fa�ade/interface into various inner Objects. The relationship is established because the nature of an ArticleBO can only exist when it has these entities within otherwise it's a useless shell)

The commentsBO kind of threw me when thinking along those lines - it only took a sobering thought / reading of cfcdev when I came to the conclusion (like others before me - I'm slow so back off! Hehe) that an Article can exist without Comments, so the relationship really isn't one that concerns an Article... I.e. the Article couldn't give a rats-a-hole whether comments exist or not. Where as it MUST have a series of internal objects like titleClass,bodyClass,ImageClass etc) for it to successfully exist as a singular business entity.

I consider it more a Business Object encompassing all these internal ingredients vs. a manager, as their can be many of these and from my (limited) understanding a manager is something that manages many business objects? - thus I went down the whole "Composite Entity Pattern" path... Probably the ArticleBO & CommentBO was a poor example. Maybe SelectBox/ListBox would be a more realistic use?

Note: Of course translation to CFMX and you start asking "titleClass? Huh.. You're mad!" - to which I fully agree - but for basic illustration purposes the above example was served, not saying I would go to the trouble of writing a titleClass to simply stowe away an article.. That's OO abuse hehehe..


Regards,

--------------------------------------------------

Scott Barnes

System Development Engineer

 

Goro Nickel Project
Level 8, 201 Charlotte Street
Brisbane QLD 4000
Email: [EMAIL PROTECTED]

 

Personal Blog: http://www.mossyblog.com

 

Reply via email to