Hi,
Starting from today I'm going to spend some time every week on the V2
Architecture/Redesign. Today I'd like to start at the heart of the
topic with the domain model. Here's my proposal:
* Model classes are classes representing the XWiki model. The main
classes are:
- Farm
- Wiki
- Space
- Document
- XObject
- XClass
- (probably lots of others)
* As you can see I'd like to introduce the Space and Farm objects
* We create a model/ build module in trunks-devs/xwiki/model for
storing model classes
* Model classes cannot access other classes outside of the model/
module. They are meant to be used by components to provide services
but they shouldn't provide services themselves. They can methods to
manipulate their fields and they can call each other but they cannot
call outside of their model.
* We use the org.xwiki.model package for storing Model classes
* These model classes are all user public (API)
WDYT?
Barring any negative feedback I'll start implementing this today and
in the coming days. One question that remains unanswered in my mind
is how do we integrate back these model classes into the V1
architecture. I think we should be able to retrofit the existing
classes to use these classes by composition. For example the Document
object could have 2 fields: one org.xwiki.model.Document and one
org.xwiki.model.Space. The XWiki object could have 2 fields: Wiki and
Farm, etc. I'm not sure how this would work out though. Any idea is
welcome.
Thanks
-Vincent