+1 Regards, James Yong
On 2017-07-14 17:59 (+0800), Taher Alkhateeb <slidingfilame...@gmail.com> wrote: > Hello Everyone, > > Data loading in OFBiz is quite fragile. A small change could crash the > system and finding out the reason can be difficult. I really felt the > pain of this when trying to disentangle the framework from data > dependencies on plugins [1]. > > I've been thinking about a solution to reduce fragility, and here are > my thoughts: > - The less data files the better. > - The less data the better. > - The less distance (e.g. same directory) between data files the better. > - No circular dependencies (file dependencies should be like a tree). > - Fail fast [2]. > > Therefore, I suggest the following action points: > - Create a directory structure similar to [3] in the datamodel component. > - For any data that two or more files depend on, immediately move it > to the common-<reader>.xml file. > - For any data that does not belong to any domain (e.g. marketing, > content, etc ..) move it to the common-<reader>.xml. > - Maintain a strict dependency hierarchy of demo -> seed -> seed-initial. > - Gradually and carefully move data from all applications to the > datamodel component as per above guidelines. > - Cleanup and refactor the data as we move it including any tests that > depend on it. > > What do you think of this proposal? Does it sound reasonable? Also > given the size of what I'm proposing I think we need multiple people > to work on this. So is anyone interested in taking part in this > initiative? > > Cheers, > > Taher Alkhateeb > > [1] https://issues.apache.org/jira/browse/OFBIZ-9322 > [2] > https://lists.apache.org/thread.html/a18b5d4086a07ff34a0cb950999e8f8e869a6aa7efa2fc866a75a7b6@%3Cdev.ofbiz.apache.org%3E > [3] directory structure: > data/ > âââ demo > â âââ accounting-demo.xml > â âââ common-demo.xml > â âââ content-demo.xml > â âââ humanres-demo.xml > â âââ manufacturing-demo.xml > â âââ marketing-demo.xml > â âââ order-demo.xml > â âââ party-demo.xml > â âââ product-demo.xml > â âââ shipment-demo.xml > â âââ workeffort-demo.xml > âââ seed > â âââ accounting-seed.xml > â âââ common-seed.xml > â âââ content-seed.xml > â âââ humanres-seed.xml > â âââ manufacturing-seed.xml > â âââ marketing-seed.xml > â âââ order-seed.xml > â âââ party-seed.xml > â âââ product-seed.xml > â âââ shipment-seed.xml > â âââ workeffort-seed.xml > âââ seed-initial > âââ accounting-seed-initial.xml > âââ common-seed-initial.xml > âââ content-seed-initial.xml > âââ humanres-seed-initial.xml > âââ manufacturing-seed-initial.xml > âââ marketing-seed-initial.xml > âââ order-seed-initial.xml > âââ party-seed-initial.xml > âââ product-seed-initial.xml > âââ shipment-seed-initial.xml > âââ workeffort-seed-initial.xml >