Showing posts with label UML. Show all posts
Showing posts with label UML. Show all posts

Tuesday, November 25, 2008

Express [posted Nov. 1st 2006 00:27]

Some time back I was discussing MDA principles (with you know who) and it struck me that UML is a great way to express ones thoughts in a structured visual way (being able to communicate a lot in a relatively easy to understand compact manner) but it or rather the tools one has to use to create it are very ineffective/inefficient. I have wondered many times how it can be that modelling tools have only a fraction of the capabilities that modern IDE's have whereas they are used to do the same thing (persist abstract thought in a structured manner). Not only are they used for the same thing they are used by people doing both modelling and coding. MOreover they are written/created by people working on IDE's. Why doesn't anybody creating a modelling tool seem to be bothered by the fact that making models is pretty inefficient. There further is usually very minimal or no support for team modelling, version control, authorisation, merging, configuration management and so on.

Setting my frustration on all these points appart I was mainly p***ed off with the fact that one, in most cases, cannot write UML like you can write code. Not that I love writing code but I can write code a hell of lot faster than I can model the same amount of meaning into UML. Wouldn't it be great if you could just write UML like code. At the moment I think you would have to write your own text to UML/XMI converter to do that or use the OMG standards of which I don't know if there are many implementations (other than producing text rather than using it as a bases) or write XMI directly if you're a real die hard. That would however not even speed up things since XMI is rather verbal. Ron once pointed out that most developers are text oriented rather than picture/figure oriented, suppose that is true for me.

Anyway to take this though a bit further I thought about why not using Java as a language to code ones model in. It is a language that has a meta language definition so why not use the OMG MDA principles to convert it to UML and from there do the [www.omg.org/mda/|MDA] thing. A more dynamic approach with more possibilities could be achieved using a more dynamic language I assumed. This led me to [www.ruby-lang.org/|Ruby] or possibly Groovy (which Ron pointed out to me). The last seemed close to dying at the time and I focussed on Ruby. Not too much later Ruby on Rails began its much famed rise. When I saw the use [http://www.loudthinking.com/|DHH] made of Ruby I was confident that Ruby would be able to deliver what was needed. It actually opened new ideas/possibilities and hopefully would make my life easier.

The idea was to create a framwork that woud support two things.

First it would support code generation based on the principle of enabling domain modelling and defining platform specific artifacts in architectural patterns, a marking model (an idea borrowed from the MDA Workbench) or Aspects. In other words the domain model stays clean and close to the language of the business and as abstract and precise as possible.

Secondly the framework would support prototyping. The importance of prototyping cannot be underestimated I think. In all projects that I have ever worked on I have seen that having something to look at and preferably work with will bring so much more understanding and inspiration to future users of a system than any model that I have ever made. It is with this that Ruby on Rails will hopefully take a lot of work out of my hands. Yes I would like to have frased this "it took a lot of work out of my hands" but I have been busy too much doing client satisfaction.

These two features would give an executable model that would be as abstract as possible and would take as little coding as possible. The executable model would help the definition of the content of the model and at any given time the model could be used to generate code fit for different platforms and architectures. This double cutting sword would possibly be more complex than a static code generation tool, but it would ensure succesfull short cycled iterations. This approach would possibly prevent a lot of hassle with round trip engineering since the code would evolve in the model and the code would hopefully only be generated to enable installing it in the target environment to test it on non functional requirements.

The way things are modelled in the dynamic model is along the lines of RoR (in fact when I first saw the "has_many" style of relationship declaration in RoR it scared me thinking DHH had created everything I thought of already) extending on it to hold more details to enable successfull generation. In fact the extensions or added information (hashes) could be specific for a certain platforms/architecture and not interfere with other target platforms. However, this is probably better addressed with marking model like constructs. The extensions will not interfere with the workings of the RoR framework allowing that to work its magic. Since the platform/architecture of that is set and proven to work the prototyping/dynamic modelling environment is ready to go.

One of the hard bits will be to generate code other than Ruby from the code written in the RoR/dynamic model. To enable this it will probably be necessary to code as much as possible in a generic way not doing any of the Ruby magic since that leaves relatively straight translation into say Java or .Net nearly impossible.

At the moment Groovy seems to be more alive than ever and JRuby is going strong. These are important it seems to me. Not because I think Ruby is not capable of doing a good job but because Java is a much more accepted language and runtime environment which is not something to take lightely in the Enterprise world. It seems to me that having a JVM as a base is more than welcome in getting companies having Enterprise environments to accept concepts like the one described here. Whatever one may think of Enterprise environments I have enough respect for them not to want to be the one standing outside having all the right ideas.

Enough talk/writing for now, time to proof that it can be done. Hopefully, with a little (or lot of) help from a my friends we can show it works soon. Any ideas on a name for the framework are welcome ;-).

YAMT [posted Oct. 31st 2006 22:48]

If two MDA tools are not enough Ron found another yet another mda tool out there called Acceleo. On the site it is described as: " Acceleo is the most powerful code generator tool of its generation. It has been designed to improve software development productivity." and it continues to explain: "Based on the Eclipse and EMF standards, Acceleo brings to everyone the MDA approach applied to development industrialization."

It is an open source MDA tool of which the creators sell a Pro verison that has extra features, prefab domain specific modeling and generation templates.

Acceleo was created by Obeo a small French company. It is a very practicle/pragmatic tool based on eclipse which makes clever use of all the editor facilities to facilitate the user in relatively easily making genration templates and generating code from UML(2) models.

Wikipedia has the following on Acceleo, I'm afraid it was written by the people who made it though.

It can be found on the Eclipse plugins site. They have further turned it into a project on the ObjectWeb.

My colleague Pascal has spent some time of late to get Acceleo to generate .Net code based on an architecture derived form the Domain Driven Design book using NHibernate as a OR mapping/persistency framework. Hopefully Pascal will share some of his experiences here soon.

Today Ron, Pascal and I had a conference call with one of the CEO's/creators of Obeo/Acceleo. He demoed the new Pro version and we were very impressed by the features that holds over the open source version. Traceablility from model to code is a big feature and very well executed.

If you are looking for an MDA tool to quickly help you on your way and well enough set up to very probably be around and usefull in the years to come you should definately check out Acceleo.

MDA tools [posted Oct. 31st 2006 21:34]

So what happened over the last year, well a lot, and very little came out of my hands except the projects that I worked on for clients. Not the most interesting stuff.

However, my neighbour in the mean time came up with two MDA tools. The first, called MDA Workbench eventually made it into the open source world. You can find it at SourceForge.net. It is described as "Capgemini's MDA Workbench is a powerful, simple MDA tool implemented as an Eclipse plug-in. The MDA Workbench allows for creating (UML) model-to-code mappings, markings and lifecycle management from model to code. Proven in very large and small projects.

As if that was not enough Ron went on and created AmplifyMDA. This MDA tool has the tagline "Amplify MDA is an open source Eclipse-based IDE that enables the generation of software components from high-level (usually UML) models. Components can be generated for any programming language (Java, Ruby, HTML, PHP, ?)".

Please do check both of these tools out. A lot of thought went into them and they have proven to be very pragmatic and usefull. And they proof once again that life's not about doing projects that customer pay for but about things that one feels passionate about. I can only say I am humbled by what Ron managed to do in the last year and I feel lucky he is willing to go and have a beer with me once in a while ;-).

Beam me up... [posted Oct. 5th 2005 23:45]

I recently read an article by Scott Ambler entitled The roadmap to agile MDA. Alas, when I just looked it up I found out it was written in 2004, which makes this response somewhat less meaningfull.

I thnk Scott has some good points when it comes to disadvantages of MDA but my main issue with this article is the fact that it is relatively easy to criticise for instance the fact that UML does not have tools to support it as good as modern IDE's and knowledge of UML being less widespread than that of Java. IDE's have been around a hell of lot longer than UML Modelling tools and there has been a lot more competition. And there will probably allways be more people that understand less abstract languages than those that use the more abstract ones.

But that is precisely the point where I don't quite understand Scott, aiming for more abstraction seems like the thing even or maybe exactly the Agile advocates should go for. I don't think code like Java or the like are that agile so why make it the basis.

The problem with people affiliating themselves too much with movements that have a commercial side to them (like Agile, but also UML, RUP and so on) is that one can never quite trust their opinion, as they might incorporate just a little commercial interest. Does this mean I wouldn't mix the two, I like to think so at least, and at the moment I know so. Yes that means this blog is far from hitting it big I'm affraid ;-)

Taking it one step further [posted Oct. 5th 2005 23:16]

The fact that Java source and comment is used in UML - Java roundtrip tools as more or less interchangeable things is completely in line with the OMG MOF model whre UML and Java are both a M2 level definition. This means, if I'm not mistaken that one could use Java as a basis for code generation instead of UML.

This would be good news since UML is still very bothersome when entering large amounts of information. At least I have found very few UML modelling tools if any at all where one could enter information as effectively as in an IDE. I had good hopes for HUTN (Human Usable UML) but I agree with my neighbour that it probaby is easier to use a syntaxt one is familiar with.

Mapping Java to UML instead of the other way around seems a problem, but one probably doesn't need to be able to express all UML features using Java to end up with a powerfull basis for codegeneration based on MDA principles.

These are exciting times indeed.

Thursday, November 20, 2008

Gone but maybe not completely [posted Oct. 5th 2005 22:57]

Don't you just hate it when you think you have a good idea and Google tells you there have been quite a number of people that already had the idea a long time ago...

When I was recently pondering the usefulness of models the thought occured to me that it would be not so difficult to generate a model repository from Java source code in a manner like JavaDoc but more advanced or enhanced. This idea as I suggested and expected was realised by others such as Compuware's JavaDoc enhanced with UML models.

Taking it one step further; all roudtrip UML-Java tools offer even more.

An interesting fact of course and completely in line with current development in MDA/code generation tools, ok, I never said it was a revolutionary idea ;-)

UML- and UML+ [posted July 15th 2005 02:02]

Recently Scott Ambler and the people from agilemodeling have opened a wiki called OpenUML. Their aim is to gather ideas to define usefull extensions or limitations to UML or define DSL's to enable modelling better than UML facilitates at the moment.

Let's hope our wiki will have some ideas about that aswell. Which remainds me I should not only write blog entries.

Hmmm, I'll write my 500 lines; "All blog and no wiki makes MTF a dull site"

Basic types go home [posted June 10th 2005 15:49]

As we did see at least in UML 2 there seems an equal treatment of associations and attributes. But why do we need the difference between composites and attributes anyway? They will never be treated comletely equal because you can name the two sides of an association and only name and attribute ones.

Why do we need to make the distinction between a composition and an attribute? One reasons that springs to mind is the much less cluttered class diagrams one gets using attributes. This however is just a way of representing a model visually. I can not let that one count.

The only reason I can think of is the fact that you can not have a composite association to basic types. Ehm, so why did we need those again? There are quite a number of OO languages that do without them. Is it a coincidence that these languages also have a realy elegant feel to them (Small Talk to name but one, and did I mention Ruby, getting to know that one, too little time though).

I guess one does not have to use the basic types, hmmm, I shall give it a serious try next modelling job I take on.

Ice cream [posted June 10th 2005 15:39]

Well just when I thought Enterprise Architect has implemented UML 2.0 I find that M. Fowler states that the "frozen" property has been dropped in Class Diagrams and that same property can still be assigned to associations in afore mentioned tool.

Hmmm, who's wrong or did M. Fowler not mean frozen on association? Another one on my list. I'll get back on that.

I scream, you scream, we all scream for ...

It's a thin line between... [posted June 10th 2005 15:35]

Ok Ok, so I was a bit unfair to UML earlier. UML2.0 does have the concept of template classes (actually I noticed it in a UML2.0 book, was it part of earlier UML versions ;-) ), hey how modern do you want to get ;-). Maybe I'm a bit harsh on UML, I've been using it for years and also don't realy have a better alternative that I can present to you here. I wich I had though because I'm quite certain it's very well possible. The idea of DSL's is one that strikes me as being a good one,

Come to speak of the improvements that UML 2.0 brings, apart form such great things like the closer union between MOF and UML. What to think of multiplicity on parameters and variables. If I may cite UML distilled by M. Fowler, for attributes the syntax is;
visibility name : type multiplicity = default {property-string} For multiplicity he states "I'll explain multiplicity on page 38" (may I just say I do not like the first person style in technical books...). When we look on page 38 we find a text about multiplicity that only fully seems to complie to associations and not attibutes. However when I take a look in Enterprise Architect by Sparx Systems (tool evaluation will folow), a great UML modelling tool for very little money (hey I'm Dutch, sorry) it turns out all multiplicity properties of associations are also available for attributes. Great! Now we do have a feature that to me everybody that used UML for something more than UML 101 has been waiting for for years. What worries me a bit is that it seems that multiplicity is further only supported in the return value of a method. And that has to take the shape of an array. Ehm. And what about parameters? Fowler seems nothing to say about that alas. Neither about the mening of aggregations. Alas agian. Maybe a little less distilled would be better next time. Does one really have to read OMG's UML superstructure document to get to know the answers to these questions? Are they that detailed/irrelevant?

When I find out the answers you can guess where I will let you known ;-)

Saturday, November 15, 2008

What good is UML [posted June 8th 2005 22:30]

One of the things I want to get into in this blog is the quality/usefullness of UML for (certain) modelling purposes.

One of the things that we all seem to discover when working with UML is that it has so little semantics that you end up defining a lot of it for each project you do. One could argue this is a powerfull feature, I think it is a weakness. It makes an argument for DSL. This could lead us straight to a discussion of Generative Programming vs MDA, it is way too early for that, first I need to get some other stuff of my chest.

One of the things that strikes me is the similarity between Java and UML. It probably isn't a coincidence that they grew up together in the mid nineties. The fact that a lot of tools that offer UML combined with coding facilities offer at least Java as a coding/generated language makes for a bias of course. The fact that both have interfaces and classes, and the same basic types (more about that in a later blog entry) might be an indication. OK UML supports multiple inheritence and C++ also has these basic types. So maybe it's more accurate to state that C++ and Java together fathered the UML syntax. Not surprising because in the mid eighties the race wasn't run. It could have been won by C++ just as easily (at least that was the general opinion then, which noone will now admit to ever having of course...). However the point I'm trying to make is not so much where UML came from but that it seems to be lagging behind on even Java and C++ today, never mind other developments (Ruby, AOP, metaprogramming, ... interestingly these have been around longer or about as long as Java and UML).

Is it wise to specify in a language that seems to have missed a great deal of the important inovations that happen around us today in the wold of software devolpment?