Friday 12 August 2005 2:27:04 am
I would like here to discuss about some methodologies and best practicies when creating an ez Publish site with lot of business logic. I will begin with a (general?) question about the class model. Let me first explain the purposes of the site we are creating. The site will be a portal to <b>several</b> companies with own products, orders, promotions, events, job infos,... All this information will have an apropriate content class (Company, Product, Order, Promo, Event, ...) Information will be reachable in different ways sometimes with lot of business logic. ex: A page that display the list of <i>users</i> having purchased <i>products</i> of a specified <i>company</i>. I would like to have some comments about: When to create an (enhanced?) objectrelation attribute and when to create a child object using nodes ? In my opinion, it should be much easier to create a logic in the placement of nodes than a template that will do a lot of complicated fetches ! Continuing with the example above, it is probably easier to have this structure:
-- Company One
+-- Buyers
+-- Person One
-- Company Two
+-- Buyers
+-- Person One
+-- Person Three
-- Company Three
+-- Buyers
+-- Person Two
+-- Person Three
And the day the <i>Person Two</i> buy a product of <i>Company One</i> an additional node on <i>Person Two</i> is created under <i>Company One/Buyers</i>. This may be probably implemented by a workflow. Now add some "categories of products" with the class <i>Category</i> that is general for all companies. How do I manage the relation between a category, a product, a buyer,... ? What about displaying all products under a specific category ? Or all products of a company in a specific category ? What about displaying all products (of every companies) that have been bought on the portal. Following my opinion, will I have to create as much directories structure and workflows as "views" ? In a OO model I will have some functions like:
Company {
Persons[] getBuyers() {
...
}
Persons[] getProductBuyers(Product p) {
...
}
}
What is your methodology to create such behaviors ? Thanks for your help :)
Patrick ALLAERT
http://www.dixite.com/
http://users.pandora.be/patrick_allaert/
|