Friday, February 27, 2009

[Arch] Cherish your Architecture

Since a few month I am following the world of architecture tools much more and there are interesting things on the way:
  • hello2morrow has changed the evaluation mode for one of it's product: SonarJ (Community Edition) is now free for trial if you have less then 500 classes. I strongly recommend to use a tool like this at least for every new project start. Quality metrics and architecture definitions are now just a few clicks away and do really suppress 'the big ball of mud' every software engineer knows.
  • Another nice product in the field of software quality measurement is sonar from codehaus. It really produces wonderful quality views for projects and I highly recommend to try it out. What disappointed me a little was that Java projects should be Maven alike and the two minute tutorial will not cause you to set sonar up in two minutes (installing, loading and producing metrics in SonarJ is much faster). But nevertheless the output is full of innovative ideas.
It was also interesting to learn that sonar has ideas to integrate something like the architecture rule checking framework macker. You can try this out for yourself and integrate it now into your Ant buildfile if you have a vision about your architecture. Do you have?

Here is an example of an architecture definition given on their website (think of everything being enclosed with XML brackets):

macker
..ruleset name="Simple example"
....access-rule
......deny
........from class="**Print*"
........to class="java.**"
......deny
....access-rule
..ruleset
macker


Do you have an idea of the intention?

Obviously a helpful feature but keep in mind that other tools (like the ones from hello2morrow) allow this definition much faster because you simply draw your architecture.

So check everything out and be aware of your architecture!

Monday, February 09, 2009

[Misc] Managing Commercial Software Projects

At IT-Conversations there is a recent interview with Jon Udell talking to Andy Singleton about "Managing Commercial Software Projects". This interview is highly recommended. Actually I figured that Singleton is following pretty much on the same track as I am. However he is making some bold statements; in projects he is using no phone-conferences ("the more phone conferences in a project the more problems the project is in") or VoIP/Video, no time-estimations are done when not explicitly demanded and he is following Open Source practices of distributed development using mostly asynchronous tool-chains.

He is apparently providing a set of development tools "best-practices" at assembla.com: One of the core concepts there is to assemble people around event-streams (of activities). I think, probably the main idea that I totally subscribe too is this: It is actually much more important to have awareness what others are doing than investing a lot of time into planning efforts.

However, listen to to the full interview, recommended!

Tuesday, February 03, 2009

[Misc] It becomes quiet around BPEL?

BPEL stands for Business Process Execution Language and will be used to execute business processes. But there are other standards which can also be used to execute your business process. What about XPDL - XML Process Definition Language? Nevertheless, many BPM vendors adopt their workflow engine to BPEL in order to survive on the BPM market. It's a mistake. Most of the products provide a BPEL engine as an additional modul, because most of the BPM/Workflow Engine products work successfully without using BPEL. At the same time as BPEL was pushed, the BPMN - Business Process Modeling Notation - was hot discussed, a notation to model business processes. When you look on the BPMN homepage you will find a BPMN to BPEL transformer, describing the mapping of BPMN elements to suitable BPEL elements.

I find an article with the topic "BPEL: Who needs it anayway?" written by Keith Swenson, discussing the usage of BPEL in the industry.
"There are a few vendors who promote BPEL as as the one-and-only-true-way to support BPM. In fact, it is good for some things, but fairly bad at a large number of other things. It is my experience that BPEL is promoted primarily by vendors who specialize in products we might rightly call “Enterprise Application Integration” (EAI). These companies have recently taking to calling their products “Business Process Management”. Potential users should be asking the question “Is BPEL appropriate for what I want to do.” In that aim, there should be a large number of articles discussing what BPEL is good for, and what it is not, but there are very few articles of this nature."
He also mentioned that BPEL supporter make the following assumptions:
  • The people making the processes are programmers
  • The activities in a process only need to send, receive or transform XML data
  • Any standard will be better than no standard
What about the human integration in BPEL? The human integration is not supported in the standard, yet. You can use the WS-BPEL Extension for People, where each vendor implement this on his own way.

In the article he illustrates how to execute a BPMN diagramm directly using XPDL. The diagram is interpreted directly without converseion to another model.

To summarize, I see there are a lot of successfull SOA projects which do not use BPEL. It goes also without BPEL. However, there are scenarios where BPEL is very useful and makes sense, but I will mention, that BPEL is not the "All-Solution" standard. I am strained on the future of BPEL.

Friday, January 23, 2009

[Tech] An easy to use XML Serializer

XML processing is an important part in present software systems, especially when communicate with other software components in the IT infrastructure. Pretty often you must provide your object data as XML. The Open Source market provides a wide range of XML tools, above all XML mapping tools, like Castor, JAXB and others. A very intersting and compact tool, existing since 2004 is XStream hosted on Codehaus. XStream is a proved XML serializing library and provides the following key features:
  • Easy to use API (see example)
  • You do not need explicit mapping files, like other serializing tools
  • Good performance
  • Full object graph support
  • You can modify the XML output
Let us consider a simple business object, person, implemented as a POJO (taken from the XStream homepage):

public class Person {
private String firstname;
private String lastname;
private PhoneNumber phone;
private PhoneNumber fax;
// ... constructors and methods
}

public class PhoneNumber {
private int code;
private String number;
// ... constructors and methods
}
In order to get a XML representation of the Person object we simple use the XStream API. We also set alias names which are used in the output XML.
XStream xstream = new XStream();
xstream.alias("person", Person.class);
xstream.alias("phonenumber", PhoneNumber.class);
String resultXml = xstream.toXml(myPerson)
When creating a new instance of the person object an serialize it via xstream (toXml) we get the following XML result. As we can see our alias names are used.

<person>
<firstname>Joe</firstname>
<lastname>Walnes</lastname>
<phone>
<code>123</code>
<number>1234-456</number>
</phone>
<fax>
<code>123</code>
<number>9999-999</number>
</fax>
</person>

The example illustrates that the framework is very compact and easy to use. Look at the 2 Minute tutorial on the XStream homepage to get more examples. You can also implement custom converter and transformation strategies to adapt XStream to your requirements.

Have fun with XStream.

Tuesday, January 20, 2009

[Pub] Data transformation in an SOA

I published a german on article on JAXCenter about data transformation in Service Oriented Architecture. When different applications talk to each other, you must find a suitable data format which all applications can interpret. For the most cases XML is the first choice, because there is a wide range of tool support and additional standards, like Schema Editors, XPath and the like.

In this article I give an overview about the Open Source Framework Smooks, which can be used for data transformation in SOAs. Smooks provide some interesting features:

  • Data Transformation (XML, CSV, EDI, Java, JSON,..) and custom transformers
  • Java Binding from any data source (CSV, EDI, XML,..)
  • Huge message processing by providing concepts like split, transform or route message fragments. You can also route fragments to different destinations, like JMS, File or databases
  • Message Enrichment
Above mentioned attributes/features are also ideal candiates where an Enterprise Service Bus can help. Rather existing Open Source ESBs, like Mule or JBoss ESB can profit from a technology like Smooks. In last part of the article I describe the Smooks extension for Mule which provides:
  • Smooks Transformer for Mule. The transformation logik is done in Smooks
  • Smooks Router for Mule. The routing logik can be configured in Smooks

Sunday, January 04, 2009

[Misc] Clean Code Developer

Some days ago the recommended .NET Expert Ralf Westphal (with Stefan Lieser) has published in his blog (which is always worth reading) about a new Software Engineering Website called Clean Code Developer (written in german).

The websites name is a little related to the book clean code from Robert Martin I recently reviewed here.

To me this website is stunning in many ways. It is the approach to bring professional development into the minds of all developers. And so it lists and explains the most important development principles on this webpage. Furthermore all tools are listed that help to achieve the goal of good development.

But the website doesn't stop here: a related forum for "clean code" discussion has been set up and they have introduced grades for every developer. So the principles have been rated and put into six grades that are associated to colors (from red to white). So every developer can learn and practice these grades and the included clean coding principles.

For those who have fun doing this you can buy a colored bangle starting from red and buying the others later for 5 €. The idea is to remind yourself always writing clean code. Whether you like the last idea is up to you. But this website really bridges an educational gap: at the university you normally learn programming and something like design patterns in an advanced software engineering course (beside of tons of UML). You nearly never learn good coding principles although many of us will code in
their later career.

So as my new years recommendation I would be happy if you can check out the website given above and join the idea of a clean code awareness.

Let this be one of our answers to the financial crisis.

Saturday, December 20, 2008

[Pub] Mule IDE

I published an article about the new Mule IDE in the current issue of the Eclipse Magazin. In the article I give an overview about Mule and how the IDE supports developers to model their Mule applications. The IDE provides the following features:
  • Mule project wizard
  • Mule runtime configuration (you can define different Mule runtimes)
  • Graphical Mule Configuration Editor
  • Start your Mule Server from your IDE
More information about the Mule IDE you can find on the Mule IDE homepage.

Friday, December 19, 2008

[Arch] Application Architecture Guide

The architecture and design of software applications should be technical neutral. The Application Architecture Guide from Microsoft guides developers through the design of applicataions based on the .NET platform. In my opinion, this architecture guide not only focus on the .NET platform and is a really good cookbook for Software Architects. As we present in our Best Practice Project, design patterns, are technical neutral and can be used in any language. The design principles of a Data Access Object or a Proxy are the same in Java as in .NET.

The guide can be used as a reference and provides the following five parts: Fundamentals, Design, Layers, Quality Attributes and Archetypes - Desgin and Patterns.

Fundamentals

The first part focus on fundamental architecture concepts, including application Archetypes, Layers and Tiers and Architectural Styles. On chapter focus on the .NET platform.

Design

The second part is very interesting for software analysts by providing some guidelines to design your application. Here you will find best practice approaches to make decisions about the distribution, select the right application type, choose the right architectural style (component based, message-bus,...). The chapter Architecture and Design is on of the most interesting one, because it provides guidelines to design considerations, architecture frame, persistence, security and some other topics. The last chapter Communication guidelines provides best practice approches to use the right communication between your software components and describes the design impact of choosing a communication technology.

Layers

The layers part focus on the layered architecture and describes each layer in detail, including Presentation, Business, Data Access and Service Layer. The layered architecture is on of the common used architecture styles in software projects.

Quality Attributes
In this part non functional requirements in software projects are described and how these requrements can be achieved by doing the right design. What must be account for to be secure and performant.

Archetypes - Design and Patterns

Don't compare this chapter with Maven Archetypes. The last part of the architecture guide describes different types of applictions, like Mobile Application, RIA or Web Application. This is very interesting because you will find which typical design principles and design patterns are used in such an archetype. For example one of the key patterns in Web Applications are Composite View, Front Controller, the classical MVC, Page Cahge or the page controller.

This architecture acts as Bibel for developers and you fill find less .NET code. In my opinion this guide is realy good and should be checked by every software architect and analyst.

Thursday, December 18, 2008

[Misc] Virtualisation for Software-Engineering

The easy accissible virtualisation tools like Virtual Box enable new applications in software engineering. An obvious usage pattern would be, to provide prepared systems for customers to evaluate that would require rather complex installations and setups.

Not so apparent is the usage in automated testing. Tests of higher granularity like integration tests are sometimes difficult to automate as they often require (again), complex installations of several components (database, middleware, legacy components...), setup of these components plus a consistent state of all these components. Virtualisation can facilitate that process significantly. The developers can create a consistent image of the system where all dependent systems are properly installed, configured and fed with data.

This image is used as reference. In the build and test automation one has to get the clean image, start it, install the more "dynamic" modules, i.e. the system under development and test, and execute the (integration) tests in the virtualisation, then collect the test results and shutdown the virtual system again. That procedure allows deterministic test-scenarios on different machines, also (or particularly) on a continuous integration server.

Sounds good, however in practice I am still missing some tools that support that. Linux in the box is of course a good start as everything is easily scriptable. However, if you want to include the virtualisation into the build-automation (e.g. in Maven) and into the continuous integration server, plugins to Maven/Ant... would be useful that allow to control the virtualisation environment, trigger activities there and retrieve data (e.g. the test-results).

In an initial research I did not find much tools in that area, any ideas?

Tuesday, December 09, 2008

[Misc] Glassfish

I recently informed myself about the (Sun) Glassfish J2EE server. I never took it as a serious competitor in the field, as I had the impression it is just a reference implementation that is from Sun... However, I had to change my opinion. In the recent years it seems, that the Glassfish community worked hard on their baby and currently it seems to be a solid competitor in the field.

The Glassfish univers "not only" contains a J2EE server, but actually a set of Enterprise-tools like as message broker, clustering framework, enterprise service bus (JBI compatible), a library to implement SIP applications and the like. Additionally it is well supported by the Netbeans IDE. The recent (preview) version contains a J2EE runtime that additionally supports scripting languages like Ruby and Groovy and is based on the OSGi framework.

What I do like additionally is the fact, that Glassfish comes with a decent installation tool, provides a solid web-based administration interface and seems to be reasonably well documented. And, of course, the whole stuff is Open Source.

I must say, I am quite impressed so far. Any comments on that one?