Thursday, February 28, 2013

SOA vs. DRY

In his presentation "Designing For Rapid Release" (slides) Sam Newman points out an ugly fact that we often try to ignore: SOA and DRY are to a large extent opposed forces.

Of course this is not a new break-through discovery and I guess it is also nothing new for most battle-proven enterprise developers. But I also have the experience that in most SOA projects this topic is treated like the crazy uncle in the attic: You don't talk about it and you certainly don't plan for it.

The result is usually a schizophrenic feeling: The architecture postulates nice decoupling, but in reality we end up with the feeling that we are not doing it right: either we are using shared logic in several services which negates idea of decoupling or we have a lot of code duplication.

In the presentation Sam illustrated this conflict with two services that share a common domain model:

Screen Shot 2013 02 17 at 4 53 06 PM

In the above picture, since service A and service B are both using a common model from a shared library, they get tightly coupled. On the other hand managing the development and releases of the shared library all of a sudden gets much more complicated under the premise that service A and service B should be decoupled.

He further brings the incompatibility of SOA and DRY to the point with the following quote:

Ending up with tightly bound services because of code-reuse is significantly worse than to copy & paste that code.

I like that Sam makes the conflict between SOA and DRY explicit. Not ignoring this fact is the first step to objectively balance the tradeoffs and to honestly plan how to deal with the drawbacks of either approach.

Friday, February 15, 2013

Quotes of the Week: Developer Testing

quotes2.jpg
Nothing makes a system more flexible than a comprehensive suite of tests! Far above good architecture and good design!
- Robert C. Martin,
Oredev 2008 Keynote
 
 
We have as many testers as we have developers. And testers spend all their time testing, and developers spend half their time testing. We're more of a testing, a quality software organization than we're a software organization

 
TDD is a discipline for programmers like double-entry bookkeeping is for accountants or sterile procedure is for surgeons..
 
 
Tests should be made a first-class citizen and treated like any other feature.

TDD, BDD and other high-ceremony techniques are not recommended for startups! Code is not important in the beginning!

 
I see TDD as a valuable and important development technique, but there are contexts in which it shines and others in which it is a hindrance.

 
Insisting on unit tests won't make those unit tests valuable.

 
I get paid for code that works, not for tests, so my philosophy is to test as little as possible to reach a given level of confidence.


If I don’t typically make a kind of mistake, I don’t test for it.

 
Testing is overrated!
 

A survey of all the studies on TDD has shown that the better the study done, the weaker the signals to its benefit.


Thinking you can improve quality by doing more testing is like thinking you can loose weight by weighing you more. […] If you want to improve your software, don't test more; develop better.

- Steve McConnell, Code Complete

You cannot inspect quality into a product. The quality is there or it isn't by the time it's inspected.

 

Much of the essence of building a program is in fact the debugging of the specification.

 

Wednesday, December 26, 2012

The boundaries are blurring

1981759130 caster semenya zwitter leichtathletik 9It's interesting to watch how the recent trend to mobile and browser applications is changing the traditional understanding of client-server separation and how the traditional territories of some technologies are blurring.

Two recent examples in the field of persistence technologies illustrate this blurring of boundaries quite well:

  • JBoss Errai
    JBoss Errai represents the opposite trend compared to Rack::CoreData: It takes JPA into the browser! JPA is traditionally a server-side (or at least server-interfacing) technology. I am pretty sure that it was not intended as a browser technology. But with the rise of HTML5 and browser-side persistence there is the pressure to take that programming model to the web client.

It seems that the triumph of mobile apps and rich internet applications has quite a disruptive effect on the traditional server-side technologies and frameworks.
I am wondering where this will lead? Both of the above examples do not feel quite right in my opinion… but hey, maybe we will get JPA support in HTML6 or Oracle will include direct CoreData support in the future ...

Friday, December 14, 2012

Presentation: vert.x - asynchronous event-driven web-applications on the JVM

This week I was invented again to speak at the SBB Developer Day 2012.

My presentation was about vert.x:

 

SBB2012

I enjoyed the event very much, and I hope to be invited again next time.

Thursday, September 13, 2012

Tidbit: Hibernate bashing deluxe

This short speech from JavaZone 2011 is just ingenious! It really made me laugh out lout again and again.
I can fully recommend to watch the video (it's only 9 min), you will be amused, even if you don't know much about hibernate...


Hibernate should be to programmers what cake mixes are to bakers: beneath their dignity. from JavaZone on Vimeo.

Favorite quotes:

Frameworks like Hibernate leave you with pretty much exactly the same amount of work you had to do anyway, only now you are not enjoying it at all.
I present to you: Hibernate - the naked emperor's hairy butt-cheeks!
If Hibernate was a part of your team, you wouldn't even let him anywhere near your database.
We used to write algorithms, now we are writing annotations. Are we meant to be happy about that?

Monday, September 10, 2012

QuickTip: Programmatic MBean access under JBoss

I have been struggeling a bit with the programmatic access of MBeans under JBoss. This is my current conclusion.
With JBoss 5 there are two methods for accessing MBeans:
  • By JNDI-lookup of the RMIAdaptor. With this method you need the JBoss client libraries (the jars in your $JBOSS_HOME/client) on the classpath since the RMIAdaptor is a type that is provided by JBoss.
  • By pure JMX. You don't need the JBoss client libraries your class path here. 

The following snipped shows both methods:

With JBoss 7 the way to access MBeans changed quite a bit: The tricky thing here is, that you need the JBoss client libraries (the jars in $JBOSS_HOME/bin/client) on your classpath even though you don't explicitly import types provided by JBoss.

If the client libraries are missing, you get the following exception: java.net.MalformedURLException: Unsupported protocol: remoting-jmx

As far as I could figure, this is the only way to access MBeans under JBoss 7.

Tuesday, September 4, 2012

/ch/open Workshop-Days 2012

image

Simon and I are holding a workshop about object relational mapping with JPA2 next Thursday at the /ch/open Workshop-Days 2012.

This year is the first time since we are doing this course that the workshop is not fully booked… probably JPA is getting an uninteresting legacy technology?

So if you don't know what to do next Thursday, you can still get a seat in our workshop … however if I am honest I would suggest to have a look at the parallel course "Java EE testing revised with Arquillian" … it looks very promising. I would definitely attend that course, if I had a choice. 

Related Posts Plugin for WordPress, Blogger...