Nuxeo Platform supports adapters on the Document Models.
This allows to wrap DocumentModels in a Java Object that implements a dedicated interface.
Since I see in the code at several places the usage of consts to retrieve propertise of DocumentModels this could make sense to encapsulate all this in adapters.
This way the EasySOA code only depends on a Java interface and does not have to care about DocumentModels and properties that are a details of the storage impl.
Typically everything inside org.easysoa.doctypes could be adapters.
There are very few examples of Adapters in Nuxeo Platform source code because this feature is usually mainly used in implementation projet to hold the "Domain Model" of the application.
But inside the platform, we use Adapters for technical features :
getting a Blob from a DocumentModel : BlobHolder adapter
getting the HTML Preview of a DocumentModel : HtmlPreviewAdapter adapter
commenting a DocumentModel : CommentableDocument adapter
accessing differents views on a Picture DocumentModel : PictureResourceAdapter adapter
accessing differents versions of a DocumentModel : VersioningDocumentAdapter adapter
Nuxeo Platform supports adapters on the Document Models.
This allows to wrap DocumentModels in a Java Object that implements a dedicated interface.
Since I see in the code at several places the usage of consts to retrieve propertise of DocumentModels this could make sense to encapsulate all this in adapters.
This way the EasySOA code only depends on a Java interface and does not have to care about DocumentModels and properties that are a details of the storage impl.
Typically everything inside org.easysoa.doctypes could be adapters.
There are very few examples of Adapters in Nuxeo Platform source code because this feature is usually mainly used in implementation projet to hold the "Domain Model" of the application. But inside the platform, we use Adapters for technical features :
You can get more info here.
Anyway, this is something we should consider for EasySOA Domain Model.
=> My guess is that Marwane and me should work on that ASAP :