Hi, Very interesting, and I'll follow with great interest. I forgot to mention that my main use-case, in the short term, is user generated forms, so I am looking at the problem 'domain' from a different perspective.
If I wanted to generate Java classes with Isis annotations I would use the technology I know well, which is XSLT. Probably build an XML Schema and generate Java classes of that, (maybe you can customise JAXB to add annotions?). I don't like the idea of a DSL personally, unless its done as a throw away thing. An XML Schema might have some long-term usefulness. In terms of communication with programmers Oscar, I suggest taking a lead from DDD and just start writing Java class skeletons. Maybe you could have Eclipse templates for the standard sets of annotations that you use? Thinking on my feet a bit, as an concepual modelling approach, create two interfaces: one called 'entity' and one called 'relationship'. All your class skeletons will implement one or the other simply as a marker. Entities are concepts that stand-alone, relationships are concepts dependent on either entities and/or on other relationships. Every process/service in the system will be represented (it's a model) by a relationship class, the types it references will be the things involved in the process (think of the model class you create as the orchestrator of the process). Write descriptions of the classes as comments as you go, so you can generate JavaDoc (hypermedia) as design documentation for your programmers. (Writing things down is good for thinking). This will be detailed for the process classes, eventually these classes will disappear from the model, but the documentation can evolve and be moved to user and/or technical documentation, with generated UML diagrams maybe, as its final format. Once you have this 'model in code' install a dependancy graph visualisation tool in Eclipse for your programmers to get a graphical 'feel' for the model [1]. This should automatically position the entities around the edge and the relationships in the middle of the graph/cloud. Another tool that does this graph generation from Java code is the the Visual Understanding Environment (VUE) [2]. Start you agile iterations! Might just have to try this myself ;) [1] https://www.eclipse.org/gef/zest/ [2] http://vue.tufts.edu/ On Sun, Nov 15, 2015 at 4:47 AM, Óscar Bou - GOVERTIS <[email protected]> wrote: > I'll look at it in detail. > > Thanks! > > Oscar > > > > El 14 nov 2015, a las 18:34, Dan Haywood <[email protected]> > escribió: > > > > Yep, I'm thinking something similar. > > > > Will take a look at capableobjects, but think I'll make plantuml my main > > focus. Perhaps you could see what the plantunl/xtext/Eclipse story is, > and > > whether it fits your desired work flow . > > > > Cheers, > > Dan > >> On 14 Nov 2015 17:23, "Óscar Bou - GOVERTIS" <[email protected]> > wrote: > >> > >> Really nice to hear is your full circle, Dan :) > >> > >> Mine also. > >> I started all this by using the excellent Bold for Delphi components, > now > >> Capable Objects MDriven Framework [1]. > >> It was wonderful to design in Rational Rose your entities, including > >> constraints in OCL, and after that generate the code, reverse engineer > and > >> use OCL as the query language to traverse the domain relationships. > >> Please, take a critical look at [1], as it was the only MDA-like > >> implementation I know that really works. > >> I have a customer system running on it for 8 years without nearly any > >> maitenance … > >> Many ideas like ViewModels, etc. are also present there, but its > >> implementation is .NET based. > >> > >> > >> You’ve cited many solutions, including really agile ones that seem > >> interesting, specially plantuml. > >> For me, initially seems hard to implement the full code generation & > >> reverse engineering cycle for a codebase, but seems you think it’s > feasible > >> by putting those solutions together. > >> Love the idea to generate it from the meta-model, but perhaps some > >> “exception” might be done to include some @Programmatic actions. > >> > >> Seems plantuml is quite extended, so any visual editor based on > >> drag-n-drop must exist out there (critical aspect for me; I think better > >> visually ;). > >> > >> > >> Really love also your idea about automatically generating sequence > >> diagrams from Events derived from actions executed while testing using > BDD. > >> Each sequence task can be inferred from each BDD “step” executed, and > the > >> wrapped actions will generate events that can be subscribed to. > >> So I envision it visually depicted as each BDD step being a “group” of > >> action calls under a UML comment. > >> > >> Are you thinking about something similar? > >> > >> > >> Cheers, > >> > >> Oscar > >> > >> > >> > >> [1] http://www.capableobjects.com > >> > >> > >> > >>>> El 14 nov 2015, a las 17:24, Dan Haywood < > [email protected]> > >>> escribió: > >>> > >>> On 13 November 2015 at 09:45, Óscar Bou - GOVERTIS <[email protected] > > > >>> wrote: > >>> > >>>> > >>>> Hi all. > >>>> > >>>> I’m considering re-introducing UML Class diagrams in our workflow > mainly > >>>> for: > >>>> - graphically design the domain entities. > >>>> - modeling relationships. > >>>> - agree with names of properties, collections and actions needed. > >>>> > >>>> It would be wonderful if the UML solution could also be “integrated” > >> with > >>>> Apache Isis or Java, automating at least the entities Java skeleton > >>>> generation. > >>> This is full circle for me... I wrote a book on TogetherJ back around > >> 2002; > >>> and it was at that time that I first met Richard (Pawson) and Rob > >>> (Matthews) presenting the Naked Objects at an OO conference in Oxford. > >>> TogetherJ provided design-time synchronicity between the UML class > >> diagram > >>> and the code, while Naked Objects provided run-time synchronicity > between > >>> the code and the UI. In the original Naked Objects book you'll see > some > >>> screenshots from the app that I wrote during that all-afternoon > workshop. > >>> > >>> But I've never found a tool that was as good as TogetherJ (may it rest > in > >>> peace) at doing the design-time synchronicity . I did think that > Omondo > >>> [2] would fit the bill, but last time I tried it (many years ago) it > >> didn't > >>> work as seamlessly as I wanted. I haven't looked again for a while. > >>> > >>> > >>> > >>> > >>> > >>>> I’ve worked extensively with Rational Rose and Sparx > >> EnterpriseArchitect, > >>>> but was thinking about an Eclipse-based solution that could > >> “potentially” > >>>> be adapted to generate the Java entities with Isis annotations. > >>> > >>> A different approach might be to build a round-tripping tool from a > >> simple > >>> DSL such as plantuml [3] or graphviz,[4]. I like these "low-fidelity" > >>> diagramming notations for several reasons: > >>> a) they are fast to work with > >>> b) their lack of UI features means that the temptation to waste time > >>> fiddling with the layout is much reduced > >>> c) they don't really scale to large diagrams. I see this as a benefit > >>> because (i) one must focus them to a single module within an app and > (ii) > >>> it limits that module's size to no more than 10 classes or so. > >>> > >>> What's interesting to me is that both of these DSLs are understood by > >>> asciidoctor-diagram [5]; we of course use asciidoctor for the Isis > >>> documentation; so there's the possibility of generating the diagrams > >> easily. > >>> > >>> Moreover, there are also integrations of both plantuml and graphviz > with > >>> xtext, meaning that one can take a plantuml diagram and visualize it in > >>> Eclipse. A quick google threw up [6] > >>> > >>> Presumably also there is some sort of metamodel within these tools that > >>> could be leveraged. I'm thinking that this could be fed into a code > >>> generator to create Isis entities. > >>> > >>> This raises the question, what sort of code generator? Well, > >>> coincidentally, I've actually started building such a code generator, > >>> isis-cli [7]; a la Grails / Spring Roo / JHipster. It would be kinda > >> cool > >>> to be able to pipe from a file containing plantuml to the isis-cli, and > >>> have it create/update Java classes with appropriate Isis annotations. > >>> > >>> ~~~ > >>> Going the other way, we could also have update the maven-isis-plugin so > >>> that it could generate plantuml diagrams based on an Isis metamodel; > this > >>> could then be fed into Asciidoctor in order to generate documentation > >> from > >>> the code. > >>> > >>> > >>> > >>> > >>>> Before joining the Apache Isis community I developed [1] for > Enterprise > >>>> Architect for automatically generating Spring Roo-based classes, but > >> Isis > >>>> was better suited for our project and I abandoned it. > >>>> > >>>> > >>>> Any ideas? > >>> > >>> I have a related idea on all this, which ties in with BDD stuff, namely > >>> that (via the wrapperfactory) the test framework could emit a > transcript > >> of > >>> a user interaction. Rob Matthews actually did this originally many > years > >>> ago in the first Naked Objects book, which shows how far ahead of its > >> time > >>> some of those original ideas were. We should probably resurrect this. > >>> > >>> But we could go further, because we could also, I think, emit plantuml > >>> sequence diagrams [8] for such BDD spec/integration tests. > >>> > >>> I know you've done lots of BDD tests, so interested in your thoughts on > >>> that. > >>> . > >>> Cheers > >>> Dan > >>> > >>> > >>> > >>> > >>>> Thanks, > >>>> > >>>> Oscar > >>>> > >>>> > >>>> [1] http://roomodeler.com > >>> [2] http://uml2.org/livecodemodel.html > >>> [2] http://jankoehnlein.github.io/FXDiagram/ > >>> [3] http://plantuml.com/classes.html > >>> [4] http://www.graphviz.org/ > >>> [5] http://asciidoctor.org/docs/asciidoctor-diagram/ > >>> [6] https://borisdevnotes.wordpress.com/2013/12/09/xtextplantuml/ > >>> [7] https://github.com/danhaywood/isis-cli > >>> [8] http://plantuml.com/sequence.html > >> > >> >
