InfoQ

Presentation

Recorded at:
Recorded at

Rod Johnson: Are we there yet?

Presented by Rod Johnson on May 31, 2007

Community
Java
Topics
AOP ,
Application Servers
Tags
JAOO Conference ,
Spring ,
Java EE
Summary
We've come a long way from the first versions of J2EE. We've learned to avoid invasive programming models, we've developed a rich set of frameworks and APIs, we know how to develop apps based around simple objects. Are we there yet? Most of us would answer no. If we're not there yet, then where are we headed next? Spring founder Rod Johnson explores this issue. Recorded at JAOO Sept 2006.

Bio
Rod is the father of Spring. The Spring Framework open source project began in February 2003, based on the Interface21 framework published with Rod's best-selling Expert One-on-One J2EE Design and Development. Rod is one of the world's leading authorities on Java and J2EE development.

About the conference
JAOO is the premier European developer conference on software technology, methods and best practices. The conference presents in-depth presentations and tutorials by researchers, engineers and trend-setters in software engineering and technology.
Circular dependencies? by Oliver Gierke Posted Jun 1, 2007 2:42 AM
Re: Circular dependencies? by Tadayosi Sato Posted Jun 3, 2007 12:40 AM
Great stuff. Let's go further. by Eelco Hillenius Posted Jun 7, 2007 12:52 AM
Deep trouble by John Harby Posted Jun 7, 2007 4:56 PM
Good summary by Rickard Öberg Posted Jun 8, 2007 3:38 AM
  1. Back to top

    Circular dependencies?

    Jun 1, 2007 2:42 AM by Oliver Gierke

    Nice one again, injecting domain model classes leads to circular dependencies between service layer and domain layer in my opinion. Consider following packages

    foo.bar.pethealth.domain
    foo.bar.pethealth.service
    foo.bar.pethealth.service.impl

    domain contains all domain classes as Vet, Pet a.s.o., service contains interfaces exposed to clients and service.impl contains the actual implementations. So I am forced not to have a domain object in the IdentityTagRegistrationService interface to not create a circular dependency.

    Okay, this question lead to the question if its reasonable to expose domain objects to service clients, but for some applications it would be overhead to create DTOs for that purpose 'cause you simply would copy most properties and getters and setters from the domain object to the DTO class and thus duplicate code and create (unnecessary) complexity. All the DTO would be quite anemic, too.

    Perhaps in the next lower layer the problem becomes more obvious. What if I need to save objects in the logic, or retrieve further objects? DAO interfaces obviously have to expose domain objects. If I had a dependency to the DAO in the domain object then, the circle s perfect.

    Any thoughts on that?

    Regards
    Ollie

  2. Back to top

    Re: Circular dependencies?

    Jun 3, 2007 12:40 AM by Tadayosi Sato

    Oliver,


    domain contains all domain classes as Vet, Pet a.s.o., service contains interfaces exposed to clients and service.impl contains the actual implementations. So I am forced not to have a domain object in the IdentityTagRegistrationService interface to not create a circular dependency.

    If we recognize IdentityTagRegistrationService as a "Service" in the DDD sense, it is also a domain element so no circular dependency occurs. (Quite confusing, but Service in DDD is not the same as services of Martin Fowler's Service Layer.) Anyway, I agree that IdentityTagRegistrationService is not a good name for explaining architecture of the sample app.


    Perhaps in the next lower layer the problem becomes more obvious. What if I need to save objects in the logic, or retrieve further objects? DAO interfaces obviously have to expose domain objects. If I had a dependency to the DAO in the domain object then, the circle s perfect.

    Again, if you include DAO interfaces into domain packages and separate them from DAO implementations in dao package, circular dependencies disappear. This technique is Separated Interface pattern. In this case, DAO interfaces can be regarded as "Repository" of DDD and repositories are residents of domain model in their own rights.

    SATO, Tadayosi
    www.ouobpo.org

  3. Back to top

    Great stuff. Let's go further.

    Jun 7, 2007 12:52 AM by Eelco Hillenius

    That was a good presentation, and indeed how much better does the Java landscape look today. I do hope that Rod and friends someday will take up the defense for OOP in web applications (additionaly with AOP if you want). Clear responsibilies. Encapsulation. All that good stuff should have a place in the web tier like it has in the rest of your software.

  4. Back to top

    Deep trouble

    Jun 7, 2007 4:56 PM by John Harby

    Check out this link:

    www.eia.doe.gov/pub/oil_gas/petroleum/feature_a...

    Looks like we've only 40 years worth of oil left. What do we do when we run out?

  5. Back to top

    Good summary

    Jun 8, 2007 3:38 AM by Rickard Öberg

    This was an excellent presentation, that I hope many many people will watch. I wholeheartedly agree with the background description and problem summary, and with the ideas of moving more towards an object-oriented domain model. We have been using this approach in SiteVision for a long time, with AOP as the enabling technology, and have found it to be a good way to avoid the pitfalls Rod outlines.

    That being said, I think there are better ways to solve this than to use AOP. But, one step at a time. First everyone must understand the absolutely horriffic situation we are in today, as described in the presentation.

Educational Content

Brian Marick on 4 Challenges and 5 Guiding Values of Agile Software Development

Brian Marick takes us through a quick tour of the most important values and challenges to adopting Agile successfully (they aren't the typical challenges and values we hear in the community).

Are You a Software Architect?

The line between development and architecture is tricky. Does it exist at all? Is an ivory tower actually needed? There's a balance in the middle, but how do you move from developer to architect?

Agile – A Way of Life and Pragmatic Use of Authority

The word 'authority' sometimes produces an allergic response in hard-line agilists. Freedom and authority – both are bad if misused and both are good if used in right spirit for a noble cause.

Getting Started with Grails, Second Edition

"Getting Started with Grails" brings you up to speed on this modern web framework. Companies as varied as LinkedIn, Wired, and Taco Bell are all using Grails. Are you ready to get started as well?

Using ITIL V3 as a Foundation for SOA Governance

Those familiar with only ITIL V2 often scoff at the thought that ITIL could serve as a governance framework for SOA. With ITIL V3, the focus of the framework shifted towards service-orientation.

Adrian Colyer on AspectJ, tc Server and dm Server

SpringSource CTO Adrian Colyer discusses AspectJ, SpringSource's dm Server and tc Server products, OSGi and Scrum.

Adam Wiggins on Heroku

Heroku's Adam Wiggins talks about Rails, Background Jobs, Add-Ons, Ruby, and how Heroku manages to work around Ruby's inefficiencies using Erlang and other languages.

SOA as an Architectural Pattern: Best Practices in Software Architecture

For Grady Booch the foundation of a good architecture is patterns, SOA being just one of many patterns. In this Second Life presentation, Booch attempts to bring more clarity on what architecture is.