Thank you David, please see inline:
On Mar 15, 2012, at 6:08 AM, David E Jones wrote: > > I think the Moqui Framework is already to a point where migration of > OFBiz business-level artifacts could begin immediately. Of course I would be happy to see (and help with) an effort to create a relatively complex proof of concepts for the migration. Then we will have a better ground to evaluate pros and cons of the two frameworks. > > Doing a migration like this would bring up other issues... including > whether or not to clean up the data model and services while at it, > especially rewriting messier parts of OFBiz like the ShoppingCart* > objects and order processing stuff in general. > It will be very difficult to rewrite existing stuff, and doing this before or after the migration wouldn't change its complexity. For this reason I think we can keep this topic out of this thread for now. However, instead of rewriting, we could clean up what we have in OFBiz before the migration... especially if this could simplify the migration or make the existing code better organized. For example, in another thread I was proposing to merge the existing application components into one, with possibly one webapp and less (and more consolidated) files: this may seem a huge effort but it may not be, because it could be done in baby steps with a lot of string replacements, moving/renaming files around etc... we could even create some scripts to simplify the effort. But again, also this could be done before/after the migration (or never). > If you want to stick with everything as-is and just do a migration, that > should actually be much less work than you might think. I have some FTL > templates to transform entity and service definitions, and a partial > template for simple-methods. Similar templates could be made for screens > and forms, though they are more complicated and may require more manual > work. Things like groovy scripts and Java classes will also require a > bit more work, but many patterns are similar so it would be much less > work than moving to an object-relational sort of framework (ie > Hibernate/JPA type of thing). This doesn't help much to make me comfortable :-) David, it may help if you could list a series of tasks (if any) we could perform in one of the OFBiz application components to make it more ready to be migrated: the tasks should ideally be doable in steps, and after each step the component should be usable in the existing OFBiz framework; but the code should be more compliant with the future layout of Moqui (or with what the migration scripts will expect); for example we could: * merge/split service, entity, screen/forms definitions in one/more files * merge Groovy scripts into one file with several methods (one per data preparation script) * merge/split Java classes for services * merge/split xml files with services * etc. etc.. > > While on the topic, some notes about things I saw in some related threads: > > 1. the DSL/Helper class effort is in principle just an improved API for > framework tools; Not only this; well, yes it is simply this at the technical level but it is much much more in the end result and approach: in fact in my poc I have laid out some simple but very effective best practices for programming services and events: the code I added is minimal (a few lines... that after Adrian's refactoring became 10 times more... but the OFBiz community likes heavy stuff :-) ) and in fact the building blocks of my work have been there since we introduced Groovy for scripts (to replace Beanshell); but since then no one really did this small step to enable Groovy (with a series of best practices and a small set of methods) to be used in a way that is perfect for OFBiz (and it was the reason that made Minilang such a productive tool). I really think that the 50 lines of code I wrote, together with the best practices defined by the two examples I have provided (for error/event/message handling) would represent a huge step ahead if used extensively to create new code (or to convert old one). But of course the same concepts can be easily applied to Moqui. > the OFBiz framework tools were originally implemented > independently, and based on a LOT of static methods and static > initialization, resulting in an "API" that is made up of a bunch of > independent objects that I've found are opaque even to developers with > years of OFBiz experience (ie they are not aware of functionality > because it is so hard to find); the Moqui API takes care of this problem > with an API designed to actually be an API as opposed to a bunch of > independent classes that evolved; for more info on that, see: > > http://www.moqui.org/apiJavadoc/index.html > > ... and the central object of the API (that also has contextual details > for the current request/user/etc): > > http://www.moqui.org/apiJavadoc/org/moqui/context/ExecutionContext.html > > Here are some quick examples of how this looks in actual use (from the > sendEmailTemplate.groovy script; sorry for the wrapping): > > def emailTemplate = > ec.entity.makeFind("moqui.basic.email.EmailTemplate").condition("emailTemplateId", > emailTemplateId).one() > > String bodyText = > ec.screen.makeRender().rootScreen(emailTemplate.bodyScreenLocation).renderMode("text").render() > > Map cemParms = [sentDate:ec.user.nowTimestamp, subject:subject, > body:bodyHtml, fromAddress:emailTemplate.fromAddress, > toAddresses:toAddresses, ccAddresses:emailTemplate.ccAddresses, > bccAddresses:emailTemplate.bccAddresses, contentType:"text/html", > emailTemplateId:emailTemplateId,fromUserId:ec.user.userId] > ec.service.sync().name("create", > "moqui.basic.email.EmailMessage").parameters(cemParms).call() > The Moqui API is of course cleaner because it was implemented from scratch based on lesson learned so far in OFBiz, and this is a *great* reason for me to consider the migration to Moqui (another one is that you are the architect of Moqui). However I would be really interested to see a service implementation in Moqui of one of the Java/Minilang services we have in OFBiz, like the poc I did to demonstrate my work on Groovy+DSL. > 2. consolidating OFBiz data model and services into a single component: > this is the way the Mantle UDM and USL are currently organized, though > they are restricted to very generic stuff and application-specific > extensions would live in the corresponding application > > 3. running in a single webapp: while this isn't necessary with Moqui, > the Moqui Screens are a combination of the controller.xml entries for > the particular screen and the OFBiz Screen Widget, and are hierarchical > instead of being flat like the request-map URIs in OFBiz; this allows > apps to plug into a screen hierarchy from separate places (by explicit > inclusion, a database record, or implicitly by directory structure) The existing OFBiz screen/form widget is an area where OFBiz should be greatly improved in my opinion. Some of the things I don't like: * the "configuration by exception" patter should be used more extensively (most common screen definitions, controller entries etc... should not be required) * it is difficult to build complex Ajax screens * I don't like the xml code for screen/form actions: it is limited and it is an additional programming language to learn * in simpler screen it is an overkill to maintain in separate files the data preparation script, the form definition and the screen definition * the html code that is produced by the widgets is ugly and difficult to maintain It seems that some of the points above have been addressed by Moqui; David, did you ever consider to integrate other ui frameworks in Moqui? I know that in Moqui there is a more powerful mechanism to automatically render ui elements (e.g. submenu items for subscreens etc...) but frankly speaking I am less interested in them because I have learned that these tools are great to cover the 80% of the requirements of a ui but the work on the remaining 20% still has to be done in each and every screen to make it really usable. But I would be really interested to see a rather complex Moqui screen that uses Ajax and calls events: this would help me to evaluate the advantages of the new solution. Kind regards, Jacopo > > ================================ > > This might actually be good in a separate email, but anyway... > > The Moqui Framework would be a separate project from OFBiz, and while > some OFBiz committers could certainly become moderators for Moqui that > would be based on their personal efforts and merits and not anything to > do with what happens or has happened in OFBiz. > > Moqui has a lot more extension points built-in than the OFBiz Framework, > so you can actually do quite a bit without changing the framework > itself. For cases where changes are needed (or wanted) to Moqui itself > they would go through the normal feature request and patch submission > process for Moqui to be reviewed by a moderator. Initially this would be > me, and I obviously have some skin invested in an effort like this so > I'd try to be responsive as possible (I have been so far with Moqui, but > most of the time it has had light traffic so I've been able to get > things reviewed and changed/fixed within a couple of days). > > One of the easiest ways to do that is with a pull request on GitHub. In > fact, if the OFBiz variation of the Moqui Framework was managed on > GitHub you could customize things there as desired while still being > able to submit changes back to Moqui and get updates from Moqui so that > OFBiz can more easily participate in the Moqui community. In git > terminology this would actually be a "fork", and I think is what Jacopo > was talking about. > > Still, for the most part my guess is that this would not be needed and > I'd recommend starting with just the jar files (or even just the war > file) and not set things up for easily changing the framework until the > need for doing so is well established. > > For this interested in considering Moqui for use in OFBiz, the tutorial > and framework intro docs are probably the best places to start, and the > Run/Deploy doc is also helpful (BTW, the moqui.org site is actually > running on Moqui, and the tutorial and run/deploy docs are actually > cwiki documents (confluence-style wiki text)): > > http://www.moqui.org/framework/docs/Tutorial.html > > http://sourceforge.net/projects/moqui/files/IntroductionToMoquiFramework-1.0.1.pdf/download > > http://www.moqui.org/framework/docs/RunDeploy.html > > Anyway, sorry for the delay in responding to this. I'm still a bit busy > on contracts and I only catch up on the OFBiz mailing lists every week > or so. > > -David > > > > > Jacopo Cappellato wrote: >> On Mar 2, 2012, at 7:50 AM, Hans Bakker wrote: >> >>> Jacopo, >>> >>> You would even consider forking? >> >> From Wikipedia [*]: >> >> "[...] More recently, distributed revision control (DVCS) tools have >> popularised a less emotive use of the term "fork", blurring the distinction >> with "branch". With a DVCS such as Mercurial or Git, the normal way to >> contribute to a project is to first branch the repository, and later seek to >> have your changes integrated with the main repository. Sites such as Github, >> Bitbucket and Launchpad provide free DVCS hosting expressly supporting >> independent branches, such that the technical, social and financial barriers >> to forking a source code repository are massively reduced." >> >> In order of preference (descending), here are the options I see for the >> future of the OFBiz framework: >> >> 1) develop a great Apache OFBiz framework 2.0 within the OFBiz community; >> then release it separately from the Apache OFBiz ERP >> 2) greatly clean up and improve the existing framework (I was not sure if >> this could go at #1) >> 3) if the above will not be possible (frankly speaking, in the committers >> group, apart from David, none of us ever implemented with success an open >> source framework) we should also consider to drop the existing code and have >> our community focusing on the ERP part (as Hans seems to advocate); at this >> point Moqui would be the most natural choice; if we will ever go with this >> path a great exchange of information will have to happen between the two >> projects: for example OFBiz will probably have to ask the Moqui framework to >> evolve some of its features; given the current nature of the Moqui project, >> I doubt that the OFBiz committers will be ever invited as committers there; >> if Moqui will be our choice, I see two possibilities: >> 3.a) we base the Apache OFBiz ERP on a release of Moqui: this will only be >> possible if Moqui release will have all the features we need (and if Moqui >> community will be interested in getting contribution to evolve in the >> direction required by OFBzi) >> 3.b) if 3.a will not be possible because OFBiz will need some features that >> Moqui community will not consider as a good fit for Moqui, then, under the >> guidance and bless of David, we could work on a fork: get the code from a >> Moqui release, import in our repository and add to it, in a controlled way, >> the features we need; of course this should be always kept as close as >> possible to the original code; we could synch our custom code with every new >> Moqui release; I was not thinking about *stealing* code to Moqui and the >> fact that David is both the founder of OFBiz and of Moqui and he is both in >> the OFBiz PMC and the leader of the Moqui project will definitely facilitate >> this; but it will be still an ugly solution but for example when you said: >> "My proposal is that Apache OFBiz will be in the future just the ERP system >> based on many opensource products like birt and also Moqui...." you are >> actually implying that the ERP applications will be able to use Birt... but >> this requires > some sort of framework and what would you do if Moqui will not think that > Birt is a good fit for them? >> 4) if Moqui will not be a good option we may consider other frameworks (?), >> but it will be difficult, or continue with what we have >> >> Jacopo >> >> >> >> [*]: http://en.wikipedia.org/wiki/Fork_(software_development)
