#24 open
Tom Locke

Hobo should support 'facades' of models for sub-sites

Reported by Tom Locke | May 3rd, 2008 @ 02:29 PM | in Beyond Hobo 1.0

E.g. a "product" as seen by an admin is different to a product as seen by a customer.

At the moment we handle this by testing properties of the user in the permission methods. A better way would be to have an adapter for the model, which implements an "admin version" and a "customer version". These would be implemented in terms of the underlying model (e.g. using delegation) but could potentially provide:

  • Different permissions
  • A different set of fields (i.e. certain fields only exist in the admin site)
  • Behaviour (methods) only relevant to the sub-site)
  • A search behaviour appropriate for the sub-site
  • etc. etc. etc.

This idea furthers the Hobo principle that the controller and view layers are nothing more than thin wrappers on the model where the real substance lies. It also helps to de-compose models which could be very useful. E.g. it's common for the central "User" model to grow very complex.

Comments and changes to this ticket

  • Tom Locke

    Tom Locke July 29th, 2008 @ 10:46 AM

    • Assigned user set to “Tom Locke”
    • State changed from “new” to “open”
    • Tag set to rfe, subsites
    • Milestone set to Beyond Hobo 1.0

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages