Discussions

EJB design: Java Vaue Type V/s Value Object pattern

  1. Java Vaue Type V/s Value Object pattern (4 messages)

    Can anybody please explain me the differences between Java Value Type and Value Object pattern
  2. Can anybody please explain me the differences between Java Value Type and Value Object pattern
    It should be the same thing with different names.
  3. Excuse me, I just know there are Transfer Object and Value Object.
    What is Value Type?
  4. In my mind, a value type is:

    In Java a = b makes a copy of b and puts it in a when a is a primitive e.g. int, long, float or double. This means that a is really value type. So java uses value type for primitives.

    Typically objects (a) in java are a reference value and receive a pointer (reference) to the same object that b points to.

    If the objects are created by value, they are value objects. eg. a primitive int object would be replaced by an Integer object instance declared to be a Value object.

    Some thoughts on using value objects are:
    There is no polymorphic behavior with value objects (static method resolution). Arrays of value objects occupy a single contiguous block of memory. Member variables that are value objects occupy the same memory block as the parent object. Value objects instantiated in a statement block (like a method), are stack allocated. Value objects returned from methods are allocated on the stack... All of these optimizations would lead to lower memory usage, faster code, and reduced burden on the gc.
  5. Friends if you all can plese type Java Value Type in google and analyse the search results may be that can remove your doubts like same with diff name or never heard of thing.Becoz i am not able to grasp exactly what it is .I can give you the hints like JVT is related with managing managed entity beans or something like that .