I've read some tutorials about EMF and I still wonder why I should use it.
Until now, I was generating my POJOs from XSD schema + JXC, or by hand.
As far as I understand EMF it can be useful to define some complex relationships between the classes (one-to-many, etc...). But is that all? Isn't it more complicated to generate the code with EMF? Doesn't it add some extra-dependencies?
These include nerve regeneration, wound healing, graft behavior, diabetes, and myocardial and cerebral ischemia (heart attack and stroke), among other conditions. Preliminary data even suggest possible benefits in controlling malignancy.
There may be an association between increased EMF exposure and health conditions such as breast cancer, Alzheimer's disease, infertility, cardiovascular ailments and possibilities of miscarriage. Thus, it is important that today's electrical devices are shielded and not radiating harmful emissions into the environment.
In daily life everybody is, to a greater or lesser degree, exposed to electromagnetic fields. Examples are the fields produced by kitchen appliances, radio transmitters and mobile phones.
It was reported that EMF exposure was associated with neurological diseases such as Alzheimer's disease that is increasing the level of amyloid beta, a risk factor, in the brain. Long-term EMF exposure may result in Alzheimer disease like symptoms due to enhancing oxidative stress (Jiang et al., 2013).
In general terms one could say that using emf provides several benefits at runtime.
On a first stage you'll notice that the ecore classes (and the emf runtime) offer what you might need from your POJOs in your application. There's no further coding needed in a lot of areas whereas you would need to code a lot by hand when using plain POJOs:
Extensions to EMF even offer far more:
You could actually argue that EMF/Ecore offers a standard for POJO and a whole ecosystem grew around it that actually offers what you would code by hand in a classic approach.
To be honest, the downside of EMF is that you get tied to the Ecore runtime which is very fine if you code Eclipse based rich clients but may become an issue if you are on the server.
IF your only interest is generation of POJOs, then I agree that there are many alternatives out there to achive the same you can do with EMF.
However, Java generation was just the first application of EMF. Now there are a huge number of EMF-based Eclipse plug-ins that give your for free a lot of functionalities to manipulate (query, validate, transform,...) your EMF models.
See the Eclipse Modeling Project for a list of official Eclipse projects on EMF.
Also, take a look at Acceleo to see the flexibility of their template-based generation approach from EMF models (for Java, PHP,...).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With