The Artima Developer Community
Sponsored Link

Java Buzz Forum
get rid of DTOs with Kodo and Spring

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Marc Logemann

Posts: 594
Nickname: loge
Registered: Sep, 2002

Marc Logemann is founder of www.logentis.de a Java consultancy
get rid of DTOs with Kodo and Spring Posted: Feb 22, 2005 10:57 AM
Reply to this message Reply

This post originated from an RSS feed registered with Java Buzz by Marc Logemann.
Original Post: get rid of DTOs with Kodo and Spring
Feed Title: Marc's Java Blog
Feed URL: http://www.logemann.org/day/index_java.xml
Feed Description: Java related topics for all major areas. So you will see J2ME, J2SE and J2EE issues here.
Latest Java Buzz Posts
Latest Java Buzz Posts by Marc Logemann
Latest Posts From Marc's Java Blog

Advertisement

Lately it annoyed me more and more to use DTOs/ValueObjects, mostly because using them means creating too much classes with no business meaning at all. These objects are more or less programmer gotchas that will clutter your code in some dangerous way. So i decided to take another approach.

As some of you allready know, i am still using JDO. The only change is that i am using KodoJDO now. Even though JDO2 is not speced out yet (any news on this cruel story?), Solarmetric has a lot of JDO2 features allready in. So in order to avoid DTOs, you can easily rely on detachment. Lets say that you have a persistent user object, instead of copying the persistent object to a DTO before closing the PersistenceManager, you can simply detach the object and use it even after PM closing.

Another add-on feature of Kodo is detachment-on-close. With this, you dont even have to fiddle around with the detachment API, because it will be done automaticly on PM closing. This in combination with Spring and the automatisms regarding PM management (opening/closing/..), a lot of things went its way without too much code to write.

Of course there might be a need to use a DTO here and there, but you can handle a lot of scenarios by just using your domain object in the service layer instead of Transfer Objects.

Read: get rid of DTOs with Kodo and Spring

Topic: Drag with style in Swing Previous Topic   Next Topic Topic: Focus problems with jcomboboxes in jtables

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use