Wednesday 30 May 2007

Linked List: 30/31 May 2007

EclipseZone Podcasts

From www.eclipsezone.com I found a lot of podcasts, covering some very interesting (and appropriate for me!) topics.

And if you had time for another Java Conference...

Then I think JavaPolis is the one. From Dec 10 - 14 in Antwerp, Belgium, this must be the best value conference in the world at only 80 euro per day!

You can get a DVD of last years talks, and load of them are online as videos already.

Here's a selection, from the latest newsletter:

Tuesday 29 May 2007

Linked List - 29 May 2007

Not so much going on today... maybe tomorrow

JFXBuilder
JavaFX, the big news from JavaONE, already has an IDE on the way

Spring 2.1 Video Interview
An interview with Rod Johnson about Spring 2.1 on TheServerSide
The Top 10 Dead (or dying) computer skills
An interesting list of 10 technolgies considered to be on the way out - Cobol, ColdFusion, PowerBuilder, C, and a few more




Monday 28 May 2007

Linked List - 28 May 2007

Here's today list of Java news:

Tutorial - Converting Eclipse EMF Models to Custom XML

First off, I think EMF is great! It provides a great basis for Model Driven Architecture, which we all know is very cool.

While my first post about EMF really should be about how to use it, I believe that any developer should be able to follow the tutorials provided on the Eclipse EMF site quite easily.

So, I've been using EMF for a while, and I had a problem with how the data was peristed using the default XMIResourceFactoryImpl. It's good, it works on saving and on loading, but I needed to pass the XML to another device.
The default implemtentation stores each object as an XML element, but each attribute for the object is an XML attribute.
I can't really disagree with that way of doing things, but it didn't suit my needs.

I found this tutorial ( Persisting EMF Models with WTP ) that describes in detail what I needed to do, but I'd like to break it down into a few points in this post here (more for my own records than anything!).
The tutorial tells you which plugins are required - if it's missing any post a comment to this post and I'll list the plugins I had to use.

  • Normally when saving, you use

    ResourceSet resourceSet = new ResourceSetImpl();
    resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
    Resource.Factory.Registry.DEFAULT_EXTENSION, new XMIResourceFactoryImpl());
  • This default XMLResourceFactoryImpl should get replaced with your own ResourceFactory extending TranslatorResourceFactory
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(
Resource.Factory.Registry.DEFAULT_EXTENSION, new MyResourceFactoryImpl());
  • In "MyResourceFactoryImpl" the createResource method must be overridden, using your own TranslatorResourceImpl, which we'll call MyResourceImpl for this tutorial.
  • Provide an XMLMapping class to provide constants of the XML element/attribute names you wish to use in the outputted XML.
    The getDoctype method in MyResourceImpl should refer to a root element definition.
    Most importantly, you'll need to create a translator that is returned in the getRootTranslator method. This is covered more in the next step.
  • MyTranslator should extend RootTranslator. The constructor will have to pass through the mapping name of the root element, along with the root EClass that is to be used.
  • MyTranslator needs to provide a getChildren method which in turn creates an array of Translator. The translators then get created along the levels, the first level being the creation of translators for the root element, and then for each element underneath.
    The example in the tutorial above describes this quite well.

  • That should cover all you need to know. The Eclipse tutorial linked above really does provide everything you need, this post just condenses it into a few points.


    If you to go one Java conference this year.....

    Then maybe this is the one to go to - Jazoon'>Jazoon 2007 on June 24th in Zurich.

    I found out about this a few months back on the java.net events page. It's on in Europe, which is a big plus for me.

    And the speaker list is fantastic - Erich Gamma and Neal Gafter. Those guys are bound to have some interesting things to say.
    There's so much covered in the conference schedule. Everything from Model Driven Architecture, J2EE5, Web Services and SOA, to JavaFX... and a lot more in between.


    Welcome To JResource

    The idea for this blog is simple - to provide quality links and tutorials related to Java, and to software development in general.

    Previously, I used Erik's Linkblog http://erik.thauvin.net/linkblog/ to get my daily roundup of links related to Java, but that blog has been discontinued now.
    I hope to provide a set of links daily to interesting Java news.

    Also, I have a lot of tutorial material to add to my blog - some of it links to other sites, and some of it I have written myself. This week I'll be starting off with some tutorials on two Eclipse technologies - the EMF and the CNF.

    Finally, I plan to do a weekly chart of the top 5 podcasts that have caught my attention.

    If there is anything else you'd like to see let me know.
    James