Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

VO and Java EE 5

 
Ranch Hand
Posts: 271
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

Can someone explain to me why VOs are not necessary any more when designing with JavaEE 5?
 
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Java EE 5 contains EJB 3 and JPA. With EJB /JPA new POJO Entities are available.
With such lightweight objects representing data in Java EE applications there is no need of cluttering application with Transfer Objects.
 
Ranch Hand
Posts: 1936
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Value Object is not the same as Transfer Object (TO or DTO pattern).
Value Object means objects that don't have identity. For example, services are Value Objects.

Value Object is an important building block for software design.

However, when I talk about Value Objects, I refer to Domain-Driven Design.
 
Piotr Uryga
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Kengkaj Sathianpantarit wrote:Value Object is not the same as Transfer Object (TO or DTO pattern).
Value Object means objects that don't have identity. For example, services are Value Objects.

Value Object is an important building block for software design.

However, when I talk about Value Objects, I refer to Domain-Driven Design.



Are You serious man ?
They changed the name of pattern from Value Object (Ed1 of Core J2EE Pattern) to Transfer Object (Ed2).

You can find bunch of topics here on Javaranch about the whole case, f.e.:

https://coderanch.com/t/154686/Architect-Certification-SCEA/Value-Object-VO-vs-Transfer
http://en.wikipedia.org/wiki/Data_Transfer_Object

Question was regarding Java EE 5, so was my answer.


 
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I guess they should make an update to Figure 8.5 in the following text then, because it still mentions "ValueObject".

http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
 
Piotr Uryga
Ranch Hand
Posts: 68
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Ronald Wouters wrote:I guess they should make an update to Figure 8.5 in the following text then, because it still mentions "ValueObject".

http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html



Indeed
Here You have more up to date class diagram of TO applicable to EJB 2.x systems:
http://www.corej2eepatterns.com/Patterns2ndEd/TransferObject.htm


 
Ranch Hand
Posts: 254
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Sweeping statements like "JPA kills DTOs" and "EE5 dependency injection kills Service Locator" are nonsense. Yes, there are many situations where EE5 makes them redundant but at the same time many cases remain where these patterns are still valid.

For example:

  • You might not want to expose your entities directly; perhaps because they're too fine grained.
  • You want to avoid the anti-pattern of making everything an EJB, so you need to perform lookups in non container-managed objects.
  •  
    Hong Anderson
    Ranch Hand
    Posts: 1936
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Piotr Uryga wrote:

    Kengkaj Sathianpantarit wrote:Value Object is not the same as Transfer Object (TO or DTO pattern).
    Value Object means objects that don't have identity. For example, services are Value Objects.

    Value Object is an important building block for software design.

    However, when I talk about Value Objects, I refer to Domain-Driven Design.



    Are You serious man ?
    They changed the name of pattern from Value Object (Ed1 of Core J2EE Pattern) to Transfer Object (Ed2).

    You can find bunch of topics here on Javaranch about the whole case, f.e.:

    https://coderanch.com/t/154686/Architect-Certification-SCEA/Value-Object-VO-vs-Transfer
    http://en.wikipedia.org/wiki/Data_Transfer_Object

    Question was regarding Java EE 5, so was my answer.



    I think you misunderstood Piotr . I didn't reply to you. I did reply to the topic creator.

    I guess Sun have changed name "Value Object" to "Transfer Object", because it's not the appropriate name.
     
    jeff mutonho
    Ranch Hand
    Posts: 271
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    Kengkaj Sathianpantarit wrote:

    Piotr Uryga wrote:

    Kengkaj Sathianpantarit wrote:Value Object is not the same as Transfer Object (TO or DTO pattern).
    Value Object means objects that don't have identity. For example, services are Value Objects.

    Value Object is an important building block for software design.

    However, when I talk about Value Objects, I refer to Domain-Driven Design.



    Are You serious man ?
    They changed the name of pattern from Value Object (Ed1 of Core J2EE Pattern) to Transfer Object (Ed2).

    You can find bunch of topics here on Javaranch about the whole case, f.e.:

    https://coderanch.com/t/154686/Architect-Certification-SCEA/Value-Object-VO-vs-Transfer
    http://en.wikipedia.org/wiki/Data_Transfer_Object

    Question was regarding Java EE 5, so was my answer.



    I think you misunderstood Piotr . I didn't reply to you. I did reply to the topic creator.

    I guess Sun have changed name "Value Object" to "Transfer Object", because it's not the appropriate name.



    The confusion started when Sun started using TO for VO , but some people still referred to TOs as VOs.Perhaps I should have been more correct and used
    TO in my question
     
    Hong Anderson
    Ranch Hand
    Posts: 1936
    • Mark post as helpful
    • send pies
      Number of slices to send:
      Optional 'thank-you' note:
    • Quote
    • Report post to moderator

    jeff mutonho wrote:
    The confusion started when Sun started using TO for VO , but some people still referred to TOs as VOs.Perhaps I should have been more correct and used
    TO in my question


    I think so.

    Anyway, just to clarify about what I said that services are value objects. Actually, Services are another pattern/building block, I should not say services are value objects, sorry about that.
     
    You learn how to close your eyes and tell yourself "this just isn't really happening to me." Tiny ad:
    the value of filler advertising in 2021
    https://coderanch.com/t/730886/filler-advertising
    reply
      Bookmark Topic Watch Topic
    • New Topic