Hi Magnolians!

Imagine something like this.

I need few datatypes to use (News, Article, Wheater...) for a website.
So, we created those datatypes using Magnolia Data Module.
But, datatype definition is "declarative", right? Nothing really typed / hardcoded. In every moment I can change type definition simply changing tree property under data module config.

Now, this is our problem. We need, e.g., to perform actions on data, like:

1) Migration from existing source (import)
2) Export to a feed (xml?)
3) Custom search
4) Data aggregation
5) Worflows
...

So, we need also to access those data programmatically, using java classes.

My question is: how to MAP configuration into java classes?
We tought 2 possible solution:

------------------------------------------------------------------
CHOICE 1: use of java bean
Description: every magnolia data module type has a corresponding java bean implementation, with mapped properties and specific actions.
pro :
- it is possible to do "type specific" actions (like search, migrate, export...)
 - easy to implement
- every data type is implemented at the same ways (extension of a supertype)
cons:
 - need to re-compile every data type change (bean update)
 - little data module integration

------------------------------------------------------------------
CHOICE 2: use of a generic implementation
pro :
 - no need to keep data mapping (automatic mapping, based on conf)
 - code reuse
cons:
 - hard to implement
 - hard to maintain

Ok, now, what am I asking to you? Nothing more than, simply:
A) What would you do?
B) And why?
C) There is a third / fourth option?





Thanks so much for considering this question.

Matteo







----------------------------------------------------------------
for list details see
http://www.magnolia-cms.com/home/community/mailing-lists.html
----------------------------------------------------------------

Reply via email to