crowdcode-de / kissmda Goto Github PK
View Code? Open in Web Editor NEWKeep It Simple Stupid, MDA!
Keep It Simple Stupid, MDA!
We need to support generics (parameterized type)
At the moment we create "adder" method for Collection. We use following method naming convention:
addXxx, where Xxx is the name of the property. So if we have something like:
... companies, the adder method will look like this: addCompanies(Company company)
==> This is not nice.
Correct is something like: addCompany(Company company)
==> addCompany is always singular
We need to extend the enumeration to be able to generate something like this:
public enum QueryArgumentType {
EQUAL("EQ"), GREATER_THEN("GT"), GREATER_EQUAL("GE"),
LOWER_EQUAL("LE"), LOWER_THEN(
"LT");
String type;
private QueryArgumentType(final String type) {
this.type = type;
}
public String getType() {
return type;
}
}
We need to make the access to the UML2 and JDT more smoothly by adding a "thin" layer API and Annotations around them, just like here:
https://code.google.com/p/jaxb-fluent-api-ext/wiki/Introduction
or here:
http://weblogs.java.net/blog/kohsuke/archive/2005/06/writing_a_plugi.html
See Maven plugin Java formatter OSS project as an example how to format the Java code with Eclipse.
We need to implement kissmda-maven-cartridge-archetype: https://github.com/crowdcode-de/KissMDA/tree/master/maven/kissmda-maven-cartridge-archetype
We should create a GWT cartridge base on this I/O presentation: https://developers.google.com/events/io/sessions/331474237
We need to add JavaDoc to generated Codes from the UML documentation description.
We need to add Stereotype Service to mark classes as a Service. Generally this is just the same as Entity since we only generate Interfaces in Cartridge kissmda-cartridges-simple-java
We need to use isReadOnly for read-only property and association end.
Following rules:
If you are using String from "datatype" instead of "UML" you get such a generated getter:
Data.String getXxx()
We need to remove the "Data."
We need to finish the docs for Application and Cartridge Developers, also with the example given in that pages:
https://github.com/crowdcode-de/KissMDA/wiki/Introduction-Cartridge-Developers
https://github.com/crowdcode-de/KissMDA/wiki/Introduction-App-Developers
We don't need all these Eclipse files anymore:
We can use m2e connectors like build-helper-maven-plugin m2e connector, which should be installed additionally to Eclipse.
If we have two or more properties in enumeration we also should generate a constructor which combines every properties. Example:
...
type: Integer
name: String
...
Constructor:
...
private MyEnum(Integer type, String name) {
this.type = type;
this.name = name;
}
...
Also check these examples:
We should set the compiler to Java 8.
From this version we only support Java 8 and upwards. Java 7 is completely unsupported.
At the moment we cannot use array type something like:
persons: Person[1..*]
directly in attributes, methods return params, etc.
We need to make this possible so it is possible to model without doing something like:
persons: Collection
instead:
persons: Person[1..*]
We need to be able to mark associations to be non-generated with a stereotype called "NotGenerated".
We need to support SpringFramework 3.x with KissMDA cartridge. For this purpose we need to do following:
I added data type array in kissmda-cartridges-simple-java cartridge. I also updated the example: https://github.com/crowdcode-de/KissMDA/wiki/Introduction-App-Developers
Just follow this information:
https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide
We need to support "generic method", see: http://docs.oracle.com/javase/tutorial/extra/generics/methods.html in our method generation.
It would be very useful if we can generate an UML2 file from all Java interfaces so that we can reverse engineer a whole bunch of Java APIs.
We still didn't select an open source license for KissMDA.
Is apache 2 still up to date or should we select a different one?
We need to have a new Cartridge for JPA with Hibernate.
At the moment we have to give a name for a relationship to generate getter and setter methods. We should extend this like: if we don't have any name for the relationship just use the name of the "target" Entity.
We need to be able to model Calendar in UML
We need to improve the logging output in case of errors. Something like:
If you create an Operation in an Entity with some Parameters, those Parameters won't be generated.
We need to be able to turn on/off logger as we needed.
@pepmar: as we talked last week, we should write a cartridge for Android app... and because you know a lot about Android, you should do this... :-)
If we have something like:
package test;
Class PersonService
public Collection<Person> getPersons()
and the Person stays not in the same package:
package test.entity;
Class Person
The generation of Collection<Person>
should be something like:
Collection<test.entity.Person>
So the class Person with full package name.
We need to be able to create DTO with stereotype "Transport Object".
It would be great to implement the Java 8 Time-API in KissMDA, so that all the classes of this API can be used, without modelling them, over and over again.
It would be also great implement default methodes into the generated interfaces, if an attribute has a default value.
Currently the generated code contains nearly only full qualified types and do not use import statements.
Write an extension that find full qualified types in a compilation unit and generates import statements for them.
We need to implement kissmda-maven-app-archetype: https://github.com/crowdcode-de/KissMDA/tree/master/maven/kissmda-maven-app-archetype
KissMDA produce in IntelliJ a compiler error in kissmda-cartridge-simple-java because of duplicated classes. The reason is that kissmda-core generates test classes from test-uml.uml in the generated-sources folder instead of generated-test-sources.
The classes are generated by the unit tests. That means on maven site is everything fine. But within IDEs it causes failures.
If you have multiple modules with kissMDA and you build the maven project with -T option (multi threaded), you will get the following exception sometimes.
[ERROR] Failed to execute goal de.crowdcode.kissmda.maven:kissmda-maven-plugin:2.0.0:generate (default) on project entsorgerportal-abrechnung-domain-model: Execution default of goal de.crowdcode.kissmda.maven:kissmda-maven-plugin:2.0.0:generate failed. NullPointerException -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal de.crowdcode.kissmda.maven:kissmda-maven-plugin:2.0.0:generate (default) on project entsorgerportal-abrechnung-domain-model: Execution default of goal de.crowdcode.kissmda.maven:kissmda-maven-plugin:2.0.0:generate failed.
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:185)
at org.apache.maven.lifecycle.internal.builder.multithreaded.MultiThreadedBuilder$1.call(MultiThreadedBuilder.java:181)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default of goal de.crowdcode.kissmda.maven:kissmda-maven-plugin:2.0.0:generate failed.
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:145)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 11 more
Caused by: java.lang.NullPointerException
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:364)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getPackageForURI(XMLHandler.java:2515)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.getFactoryForPrefix(XMLHandler.java:2422)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createObjectByType(XMLHandler.java:1299)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.createTopObject(XMLHandler.java:1468)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.processElement(XMLHandler.java:1019)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.processElement(XMIHandler.java:87)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:1001)
at org.eclipse.emf.ecore.xmi.impl.XMLHandler.startElement(XMLHandler.java:712)
at org.eclipse.emf.ecore.xmi.impl.XMIHandler.startElement(XMIHandler.java:169)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:509)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:182)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:1339)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2784)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:602)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:505)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:841)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:770)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1213)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:643)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl.parse(SAXParserImpl.java:327)
at org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.load(XMLLoadImpl.java:181)
at org.eclipse.emf.ecore.xmi.impl.XMLResourceImpl.doLoad(XMLResourceImpl.java:180)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1494)
at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1282)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:255)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:270)
at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:397)
at de.crowdcode.kissmda.core.uml.ReaderWriter.load(ReaderWriter.java:127)
at de.crowdcode.kissmda.core.uml.PackageHelper.getRootPackage(PackageHelper.java:69)
at de.crowdcode.kissmda.cartridges.simplejava.SimpleJavaTransformer.getRootPackage(SimpleJavaTransformer.java:224)
at de.crowdcode.kissmda.cartridges.simplejava.SimpleJavaTransformer.transform(SimpleJavaTransformer.java:116)
at de.crowdcode.kissmda.maven.plugin.KissMdaMojo.useTransformerNamesWithOrder(KissMdaMojo.java:268)
at de.crowdcode.kissmda.maven.plugin.KissMdaMojo.execute(KissMdaMojo.java:183)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
... 12 more
Use @RunWith(JukitoRunner.class) so that we don't need any setter methods just for wiring the objects (context in DI).
Hi,
Please I have a question!!
To implement the elements of the sequence diagram for KissMDA,I need to represent the elements as a class and then automatically generate code or manually? how I will represent them? (the elements are LifeLine,Message,Collaboration..)
thank you
We need to add inheritance for the stereotype Entity and Service
We need to finish this example implementation.
In this cartridge (kissmda-cartridges-simple-java) we only generate the interfaces as Java interfaces.
Generation of Boolean or boolean property should be like this:
isXxx
setXxx
From Java Beans specification:
Boolean properties
In addition, for boolean properties, we allow a getter method to match the pattern:
public boolean is();
This "isPropertyName" method may be provided instead of a "get" method, or it may be provided in addition to a "get" method. In either case, if the is method is present for a boolean property then we will use the "is" method to read the property value. An example boolean property might be:
public boolean isMarsupial(); public void setMarsupial(boolean m);
We need to add "raised exceptions" for each method declaration.
We need to be able to generate Java enumeration.
We should be able to hook on some well-defined Events using Event Bus mechanism. See my blog for more information: http://lofidewanto.blogspot.de/2013/10/tigerteam-trimm-model-driven-generator.html
We need to add a comment for the generated interfaces, enums and exceptions, something like:
/**
* Generated by KissMDA - Simple Java Cartridge - kissmda-cartridges-simple-java.
* KissMDA: http://kissmda.org
*
* DO NOT EDIT this file manually! All changes will be overwritten by next generation!
*
* Generation date: Fri Oct 18 01:06:40 CEST 2013.
*/
At the moment the UML model is dumb. The cartridge like simple-java just take the UML content and try to generate something out of it.
We need such a "model-beautifier" or "model-checker" which allows us to make the generation always working. Example:
After we have a clean and "beautiful" model we can generate everything based on this model.
We should implement this "model-beautifier" as Cartridge Extension.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.