Thanks Nando. The reason I have Menu related to Site instead of Page because we've made an assumption that the navigation will be the same throughout the whole site no matter which page the user is viewing.
As for rendering... I am thinking of passing a representation of the Menu (e.g. array of links) to the Renderer object, but let's not go there for now. Thanks, Henry Ho On Feb 18, 11:36 am, Nando <[email protected]> wrote: > I'm not sure how anyone else will respond, but to me, a Site has Webpages - > or just Pages. The question then becomes if a Page is responsible for > rendering itself. If it is, then it should be able to render the navigation > that appears on that Page. > > I don't find it useful to model "Menu" as an entity, but maybe someone else > might. To me, it's kind of like modeling "ContentArea" or "Footer" - > conceptually these abstract terms are significant but in terms of behavior, > they aren't. > > To me, the key concept here is the behavior *render* - and the decision to > be made is who is responsible for rendering which types of content for each > Page. Does Page handle that itself, or does it delegate this behavior to > specialized objects adept at rendering various types of content, one of > which would handle rendering navigation blocks? There are various types of > nav blocks, including stuff like the left nav, footer nav, header nav, > breadcrumbs, etc. Depending on your approach, different users or sites may > require completely different "navs" to be rendered. > > If different Sites or Users require different navs to be rendered, then to > me that indicates a specialized object to handle rendering the navigation, > perhaps a generic RenderNav that can be extended where necessary. > > There are 2 things here. One is the entire navigation structure. To me, Site > seems a likely object to handle building that. Second is the *rendering* of > a portion of that on a specific Page. > > Nando > > > > On Wed, Feb 18, 2009 at 7:20 PM, Henry <[email protected]> wrote: > > > Thanks everyone for your time and effort of answering my question. > > > Sorry for confusing everyone here with my browser/bookmark > > analogy . :) > > > I'm actually building a CMS for multiple users, and I'm trying to > > model the navigation part of each CMS. This navigation part is like, > > a site Menu. The Menu has a collection of Links. Each user has a > > different Site (the obj that represents the CMS site). > > > So to mirror back to my previous analogy. > > > Browser => Site, each user has a unique instance of this. > > BookmarkManager => Menu, stateful, has add/sort/reorder/delete methods > > on a collection of Link > > Bookmark => Link (name, url) > > > After thinking about the problem a little more... This is what I came > > up with. Please give me some feedback. > > > - I remove the relationship between Site and Menu in the OO level. > > Site no longer has a reference to Menu, so Site doesn't have to have > > those one-liner delegated methods of Menu (e.g. add/sort/reorder/ > > delete). > > - I added a MenuService that returns a stateful Menu object by SiteId, > > since Site & Menu is a one-to-one relationship. > > - The View layer (.cfm) calls MenuService to get a Menu to works on > > managing Links. Once done, it'll call MenuService.saveMenu(menu). > > > What do you think? > > > Thanks all, > > Henry Ho > > -- > > Nando M. Breiter > The CarbonZero Project > CP 234 > 6934 Bioggio > Switzerland > +41 76 303 4477 > [email protected] --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en -~----------~----~----~----~------~----~------~--~---
