Diff between data objects & value objects

what are the differences between Data and Value Objects?

What exactly do you imply by "Data Objects"? If you mean Data Transfer Objects, they are the same as Value Objects. Just a new name!

Similar Messages

  • Difference Between Maps and Value Objects

    Hi Guys
    Can you please help me differentiate between HashMap and Value Object Design patterns. The trade offs of each and how to choose between the two patterns.

    It really depends upon what you really want to do:
    - If you want to transfer simple objects using their inherent structure, use your DomainObject itself or if you really need to, use a ValueObject
    - If you want to transfer a lot of similar or even different objects with unique keys, use some Map.
    Using a HashMap, you might need to consider:
    - The hashing can significantly increase your CPU load, if you are doing too much. For example you can define your hashValue() to return just the PrimaryKey, or it's hashValue() if it's an Object. And equals() needs only to compare the PrimaryKey as well. This semantic results in two objects being equal, if they have the same PrimaryKey. You may define an additional deepEquals() method, to see if an updated version contains changes to the stored version, if this is needed.
    - If you keep around references in a Map without clearing them, when you don't need them any more, the Map will increase in size. If you want to keep them, but only as memory alows, you might even consider using WeakReference<T>.
    Together with the rules provided by krunals, I hope this helped a bit...

  • Business Objects, Value Objects and more

    Hey,
    I've got a general question about business objects (aka entity objects or data transfer objects). The scenario I am using is not one of my own, but it might be a future one. Thus, I'd really appreciate all feedback.
    Let's say that i've got a desktop application which purpose is to manage personal DVD collections. Shortly explained, what i would do here is to create a class Dvd to represent a physical DVD. Then i would create the classes DvdServices and DvdDao. The DvdServices class is what my application will use to retrive and store Dvd instances, and takes care of all session and transaction handling. The DvdDao class is where all database communication takes place. This class will only be used by the DvdServices class.
    Now, say that i would want to keep things simple and use the same business object both in the front end and the back end (yes, i'm using Hibernate). That is, the Dvd instances returned by the DvdServices class is the ones i also would like to use in my GUI. This is where i start to get a little uncertain about best practice.
    Let us say that i use an instance of a Dvd to present some information about a dvd to the user. However, the user would not only like to see what's already stored about that dvd - but also edit some details related to it (such as the title, description or the like). What i would do here (to support editing), is to modify the Dvd class so that it holds a DvdAttributes object which contains all its editable values like title and description (in other words, the state - except for the id and a timestamp value). Thus, i also modify the DvdServices class and create a method called updateDvd(Dvd dvd, DvdAttributes attributes). The method updateDvd() in the DvdServices class, internally, makes a reference to the existing DvdAttributes, applies the new DvdAttributes to the Dvd instance, and tries to save it. If something goes wrong, transaction is rolled back, and the old DvdAttributes are applied to the Dvd class in order to reflect the state of the Dvd instance.I like to think of the Dvd instance as the business object, and the DvdAttributes instance as a related value object (the terminology is probably all wrong here?).
    My question regarding all this is wether it "adheres" to what one might consider as "best practices" (if something like that exists in relation to this)? Could i do things smarter in this case? Is there something which does not make sense (always good to hear a second opinion!).
    All feedback appreciated!

    sbrattla wrote:
    Hey,
    I've got a general question about business objects (aka entity objects or data transfer objects). The scenario I am using is not one of my own, but it might be a future one. Thus, I'd really appreciate all feedback.
    I don't believe a DTO would ever be considered a business object.
    Let's say that i've got a desktop application which purpose is to manage personal DVD collections. Shortly explained, what i would do here is to create a class Dvd to represent a physical DVD. Then i would create the classes DvdServices and DvdDao. The DvdServices class is what my application will use to retrive and store Dvd instances, and takes care of all session and transaction handling. The DvdDao class is where all database communication takes place. This class will only be used by the DvdServices class.
    Now, say that i would want to keep things simple and use the same business object both in the front end and the back end (yes, i'm using Hibernate). That is, the Dvd instances returned by the DvdServices class is the ones i also would like to use in my GUI. This is where i start to get a little uncertain about best practice.
    It appears that 'Dvd' is in fact a DTO. Probably best to name it as such - DvdDto.
    Let us say that i use an instance of a Dvd to present some information about a dvd to the user. However, the user would not only like to see what's already stored about that dvd - but also edit some details related to it (such as the title, description or the like). What i would do here (to support editing), is to modify the Dvd class so that it holds a DvdAttributes object which contains all its editable values like title and description (in other words, the state - except for the id and a timestamp value). Thus, i also modify the DvdServices class and create a method called updateDvd(Dvd dvd, DvdAttributes attributes). The method updateDvd() in the DvdServices class, internally, makes a reference to the existing DvdAttributes, applies the new DvdAttributes to the Dvd instance, and tries to save it. If something goes wrong, transaction is rolled back, and the old DvdAttributes are applied to the Dvd class in order to reflect the state of the Dvd instance.I like to think of the Dvd instance as the business object, and the DvdAttributes instance as a related value object (the terminology is probably all wrong here?).
    As stated no.
    Process flow would normally be like this.
    Happy path (it worked)
    1. Query - returns DvdDto
    2. GUI - display DvdDto
    3. Modify DvdDto
    4. Update (send to server/backend) DvdDto
    5. (Return - It worked.)
    Sad path (it failed)
    1. Query - returns DvdDto
    2. GUI - display DvdDto
    3. Modify DvdDto
    4. Update (send to server/backend) DvdDto
    5. Exception is thrown
    6. (Return - It failed)
    Step 6 is a bit ambigous because it depends on the user and the actual client/server relationship. It could be an exception, a message or just true/false (false is failed.)
    In the above there is no step that corrects or alters the DvdDto instance that was thrown. One reason for this is that it might be a minot mistake on the users part and if you destroy everything they alread typed in they are not going to be happy.

  • Transfer Object (Value Object)

    Hi Friends
    I am want to Use TO in Swing. But i do not know how to.
    If You have any knowledge about To in Swings please provide me.
    Thanks
    ---SunnyJain

    well that is not what i wanted ..
    They have some thing link this usage in J2EE.
    http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html
    I want to make swing client Table to use a Transfer Object to send data and receive data.

  • Diff between check and value

    Hi experts,
                 Please tell me differance between check table and value table.
    Thanks & Regards
    Ahammad

    check table is validation at field level.
    value table is at domain level.
    Value table is defined at the domain level and is used to provide F4 help for all the fields which refer to that domain.
    Check table is defined against a field in SE11 if you want the values in that field to be checked against a list of valid values. For e.g. if you are using the field matnr in a table you could define MARA as the check table.
    Also while defining a check table SAP proposes the value table as check table by default. Referring to the previous example if you tried to define a check table for the matnr field SAP would propose MARA as the check table.
    1. what is the purpose / use ?
    -- so that the user can select values
    from some master table , for that field !!!!
    2. This is done by
    CHECK TABLE (foreign key concept)
    (and not value table)
    3. When we create a check table for a field,
    then
    some DEFAULT table is PROPOSED
    4. that DEFAULT table is nothing
    but PICKED up from the domain of that field,
    and shown from the value of VALUE TABLE.
    CHECK TABLE -it is a parent table.
    for example..
    i have two tables ZTAB1 and ZTAB2.
    I have one common field in both the tables,i can make any ztable to be the check table .If i make Ztab1 to be the check table then when i have to make an entry in ztab2 i will check whether ztab1 is having that value or not..
    its also field level checking..
    Valuetable-It is nothing but default check table.
    one parent can have n number of child tables.For example
    For ztable we have zchild1 and zchild2 tables r there.
    Its domain level checking..When zchild2 uses the same domain as used by zchild1 then the system automatically generates a popup saying a check table already exists would u want to maintain it.
    go to domain and then press the value tab u can see the valuetable at the end...
    Please refer the links below,
    d/r b/n check and value table?
    wjhat is the exct difference between check table and value table
    what is the check table and value table
    check table and value table
    Re: wjhat is the exct difference between check table and value table
    http://www.sap-img.com/abap/difference-between-a-check-table-and-a-value-table.htm
    regards,
    srinivas
    <b>*reward for useful answers*</b>

  • 请教 采购申请 审批权限 的tocde,object和value?

    如题,我现在想在sap中获取 具有审批 采购申请 权限的人员名单,通过suim查询,但是不知道改权限与那个tcode,object和value相连,知道的请告诉下,谢谢了。

    非常感谢您的回复,祝您身体健康。
    其实我现在是帮一朋友问,但是我这边没有环境,而且时间紧迫,我需要一个肯定的答案,如果有明确的就好了,
    我上网搜索了下,这个object,的确和审批挂钩,但是我不能肯定。

  • Data Access Object vs. Value Object

    What is the relationship, if any, between DAOs and VOs?
    For example, suppose DAOs are used by entity beans to abstract data persistence and VOs are also used by entity beans to exchange data with the web tier. Would the DAOs extend the VOs or would they be unrelated?

    Dave,
    Dan, thanks for the response. This does help.
    However, I am assuming that the DAOs have getters and
    setters for each field/attribute. Is this correct?Typically, no.
    DAOs typically accept one or more Value Objects as arguments, providing a much coarser interface. In this case, if the VO changes, the interface of the DAO does not change, and thus its clients do not feel the ripple effect.
    If so, why not extend the VO (which implements the
    getters and setters) and just put the persistence in
    the DAO?
    Thanks again for your time. I am just trying to
    understand all the issues here.Thanks for your questions,
    Dan
    >
    Regards,
    Dave

  • Diff between object based and ob. oriented

    diff between object based and ob. oriented

    Object-oriented requires at least three factors:
    1. Encapsulation: Combining data and the methods that manipulate the data into a self-contained unit called an "object" in which the data is hidden from the user and only the method interface is visible.
    2. Inheritance: Ability of a class to extend the features of another class by obtaining all the public features of the other class while adding its own specialized features (Example: Great Dane inherits from Dog)
    3. Polymorphism: The ability to perform "late binding" by invoke methods of a subclass on behalf of its superclass. (Polymorphism includes other things and it difficult to explain.
    If a language does not include all three, it is called "object-based." Visual Basic 6 is object-based, because it allows you to define classes that encapsulate, but doesn't support an inheritance hierarchy nor polymorphism.

  • Mapping errors between data object and automated activity

    Hi,
    in a automated activity of a bpm process I try to call a web service method ("addBook") which exptects an object called u201CbookWrapperu201D. The object "bookWrapper" consist of three variables: u201Cbidu201D (Integer), u201Cauthoru201D (String), u201Ctitleu201D (String).
    When I try to directly map, for example u201Ctitleu201D, out of an existing Data Object (Filled by an human activity: u201CDO_CreateBooku201D) I got the error:
    Expected: xsd:string
    Found list of u2018com.sap.dictionary.stringu2019
    Severity and Description     Path     Resource     Location     Creation Time     Id
    The literal: "Expression for target path 'DO_BookWrapper/title' has errors." do not have type, in expression: "#erroneous=true;sources=TaskOutput/UIResponse/start/title#TaskOutput/UIResponse/start/title".     LocalDevelopmentLocalDevelopmentbook_chapter_process~demo.sap.com/src/bpmn     create book and chapter.bpmn     Expression for target path 'DO_BookWrapper/title' has errors. [Galaxy, Rule, Literal]     1260878200220     4720
    I do not know why this error occurs because both type are strings. Is it due to the fact that I do not have an object instead of variables as input parameters? I used the automatically generated data types as data objects.
    May anybody help me please? Can I make casts?
    Regards

    Hi Martin,
    From the error that you get, it is indicated that you try to map a list to a single variable.
    If you want to do so, please see the documentation http://help.sap.com/saphelp_nwce711/helpdata/en/47/63604e42bf6831e10000000a421937/frameset.htm where it is said:
    If you map a node, whose content is a list or a node, with one or more parents that are lists, to a single-valued node, you get an error. Depending on your needs you could provide custom expression, for example to aggregate the list to a single value, or you could do parent mapping between the multi-valued parent nodes.
    So you need to create an EJB function that does the conversion between a list and single value type. Here is the help for functions: http://help.sap.com/saphelp_nwce711/helpdata/en/47/63604e42bf6831e10000000a421937/frameset.htm and especially for EJB functions http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/609c9982-39af-2b10-768b-e5bd8813c1f3.
    I hope this helps you.
    Best regards,
    Radost

  • Difference Between Data Type and Data Object

    Difference Between Data Type and Data Object

    hi magesh
    <u><b>Data types</b></u> can be divided into
    elementary,
    reference, and
    complex types.
    <u><b>Elementary Types</b></u>
    Elementary types are the smallest indivisible unit of types. They can be grouped as those with fixed length and those with variable length.
    <u><b>Fixed-Length Elementary Types</b></u>
    There are eight predefined types in ABAP with fixed length:
    <u><b>Four character types:</b></u>
    Character (C),
    Numeric character (N),
    Date (D),
    and Time (T).
    <b>One hexadecimal type:</b>
    Byte field (X).
    <b>Three numeric types:</b>
    Integer (I),
    Floating-point number (F)
    and Packed number (P).
    <u><b>Variable-Length Elementary Types</b></u>
    There are two predefined types in ABAP with variable length:
    STRING for character strings
    XSTRING for byte strings
    Reference Types
    <b>Reference types</b>
    describe data objects that contain references (pointers) to other objects (data objects and objects in ABAP Objects).
    <u><b>Data Types</b></u>
    1) As well as occurring as attributes of a data object, data types can also be defined independently.
    2)You can then use them later on in conjunction with a data object.
    3) The definition of a user-defined data type is based on a <b>set of predefined elementary data types.</b>
    4) You can define data types <b>either locally in the declaration part of a program</b> using the TYPESstatement) or <b>globally in the ABAP</b> Dictionary.
    5) You can use your own data types to declare data objects or to check the types of parameters in generic operations.
    <u><b>Data Objects</b></u>
    1)<b>Data objects</b> are the physical units with which ABAP statements work at runtime.
    2) The contents of a data object occupy memory space in the program.
    3) <b>ABAP statements access these contents by addressing the name of the data object</b> and interpret them according to the data type..
    4) For example, statements can write the contents of data objects in lists or in the database, they can pass them to and receive them from routines, they can change them by assigning new values, and they can compare them in logical expressions.
    5) Each <b>ABAP data object has a set of technical attributes</b>, which are fully defined at all times when an ABAP program is running (field length, number of decimal places, and data type).
    6) You <b>declare data objects</b> either <b>statically in the declaration part</b> of an ABAP program (the most important statement for this is DATA), or <b>dynamically at runtime</b> (for example, when you call procedures).
    7) As well as fields in the memory area of the program, the program also treats literals like data objects.
    hope this helps u,
    reward points if useful
    Ginni

  • Differences between DATA TYPE and DATA OBJECTS

    I am new to ABAP,I want to know the differences between DATA TYPE and DATA OBJECTS with some examples.
    please help me regarding this.

    Hi Ashish,
    Data Types:       Are pure descriptions.
                   No memory is associated with data types.
                   Describes the technical properties of data objects.
    EX.
    1.     C-CHARACTER
    2.     D-DATE
    3.     F-FLOAT
    4.     I-INTEGER
    5.     N-NUMERIC TEXT
    6.     T-TIME
    7.     P-PACKED NUMBER
    8.     X-HEXADECIMAL
    9.     STRING-Variable length string.
    10.     XSTRING-Variable length byte string.
    Data Objects: Are created during runtime.
                    They cannot exist without the data Types.
                    Occupies memory space.
    EX:
    1.     INTERNAL DATA OBJECT- Internal Data objects
         LITEERAL- A literal has a fixed value.Ex: WRITE:u201DWORK HARDu201D.
         VARIABLES: Data statement is used to create variables.
    EX.DATA: NUM TYPE I.
    NUM: VARIABLE defined by data statement.
    EX: DATA: PRICE LIKE NUM.
         CONSTANT-It is a data object, which contains a constant value throughout the program.
    Can be declared in program by using CONSTANT statement.
    EX:CONSTANT: INT TYPE I VALUE 15.
    2.     EXTERNAL DATA OBJECT: Are defined in tables i.e In ABAP/4 dictionary you can access this data from table.
             EX: TABLES: SFLIGHT
              DATA: SEATS LIKE SFLIGHT-SEATSMAX.
    3.     SYSTEM DEFINED DATA OBJECTS:Space & system variables like SY-UNAME,SY-DATUM, SY-REPID.
    4.     SPECIAL DATA  OBJECTS:
         PARAMETERS: Are Variables ,which can accept value from user.
          SELECTION SCREEN : Are special internal tables to accept value ranges from user.
    3 APPROACHES TO DEFINE DATA OBJECTS.
    1.     ELEMENTARY TYPES
    DATA: Customer _Name (25) TYPE C,
                   Vendor_Name (25) TYPE C.
    2.     REFRENCE TO AN EXISTING FIELD:
    DATA: Customer _Name2 (25) TYPE C,
                  Vendor_Name2 (25) LIKE Customer_Name2
    3.     REFRENCE TO NON-ELEMENTARY TYPE:
    TYPES: T_NAME (25) TYPE C
    DATA: CUSTOMER_NAME TYPE T_NAME
                   VENDOR_NAME  TYPE T_NAME
    4.     RECORD-Information in rows & columns.
    DATA: BEGIN OF BOOKING,
                                    ID (4) TYPE C,
                                    FLIGHT_DATE TYPE D,
                                    NAME LIKE CUSTOMER_NAME,
                                    END OF BOOKING.
    You can also look into SAP help for more information.
    Regards,
    Indu.

  • What is the difference between data base objects and runtime objects

    What is the difference between data base objects and runtime objects

    Hi raja,
    data base objects means u can have the presence of these objects in the database.So the tables,searchhelps,structures,lockobjects comes under these ones.
    Runtime objects are created and destroyed after the program ends, any changes we make to them are temporary only.
    regards,
    nagaraj
    Message was edited by: nagaraj kumar nishtala

  • Diff. between Mass Object Controlling and Single Object Controlling

    Hi,
    Can anybody tell me what is the diff. between Mass object and single object controlling.
    I came to know that Mass Object creates the profitable segment where as single object controlling creates the internal order.
    Can anyboyd brief with exampl and what u ment by internal order..

    HI Lucas...
      here is about the three things U asked:
    let us take an example:
    Ur company is to buy spare parts of computer, assemble them with the help of ur employees and sell it finally.
    You know, you planned that ur total spare parts cost you 15000/- by enquiring in the market , labor costs is 5000/- per pc (acc. to employee wages u give to the labor)
    so, ur total computer cost is 20,000/- & u wanna sell it for 25,000/-
    Here, <b>Preliminary costing</b> per pc = 20,000/-
    But, unexpectedly, on the day u r bought parts, one part rate has gone up by 1,000/- &
    U assembled the computer & sold to your customer.
    ur computer cost has come to 21,000. (15,000/- + 1,000/- + 5,000/-)
    This is called <b>Simultanous costing</b>
    This costing is done in SAP using production order confirmation.
    at the month end(called period end closing in SAP) ur employee unexpectedly demanded to give 7000/- per pc for the pcs that were sold last month. You need that employee & u paid him accordingly. This cost u hav come to know only at the period end.
    so the <b>Final period costing</b> is 23,000/- (15,000/- + 1,000/- + 7,000/- )
    This is done in SAP using production order settlement.
    Do assign points if it is helpful
    Regards,
    chaitanya

  • Difference between date info object in characteristics and keyfigure

    What is the difference between "date" data type in characteristic and keyfigure?
    Thanks in advance.
    Raj

    Hi Rajasekhar,
    If date is characteristics,query can be analysed based on date and filters can also be set using this date.
    If it is key figure query cannot be analysed based on date,
    Based on requirements,we have to decide whether it should be chatracteristic or key figure
    Regards
    Prakash

  • Value Objects still  relevant in EJB 2.0?

    I came across the concept of using Value Objects to get better performance from EJBs as they reduce the number of remote calls to invoke to retrieve object property values.
    However, with the introduction of LocalHome and Local interfaces for EJB 2.0, is it still useful to have value objects to pass data around, typically between EJBs and the Controller (typically servlets/JSPs or session beans that implement business logic)?

    Not so fast.
    I wouldn't be so quick to get rid of VOs simply because local interfaces exist now. Keep in mind that using local interfaces is not always the right answer to your problem (since there are still situations where the client and server are not co-located within a given VM).
    Also, there are times when the brittleness of your API should be considered. If a method takes many parameters, it is often benificial to pass a single VO as a paramater rather than multiple individual parameters. This really comes into play when methods are modified to take different arguments (e.g. adding a new argument).
    Consider a method on a bean used to update a student's records for example.public StudentVO update(String firstName, String middleInitial, String lastName, int age, String ssn, String status) throws UpdateException; is much more brittle than public StudentVO update(StudentVO student) throws UpdateException;Consider what would happen if a design change makes GPA and gradeLevel part of a student's profile.
    The second method's signature would remain the same. The signature of the first method however would now read public StudentVO update(String firstName, String middleInitial, String lastName, int age, String ssn, String status, float gpa, int gradeLevel) throws UpdateException; This change would "break" the calls made by any callers of this method. While there are pros and cons to this (as well as other ways to solve this issue, such as method overloading, etc.), it is something to consider when deciding whether a value object should be used in certain situations.
    Hope this adds another point of view to the discussion.
    Note: I'm using Value Object (VO), Data Transfer Object (DTO) and Transfer Object (TO) to me the same thing here.

Maybe you are looking for

  • Battery life lenovo flex 14 - does not last long at all! (2h30)

    Hello , I got a lenovo flex 14 last september so it's very new. The battery lasts only 2 hours 45 when charged  fully.  I find it too short considering the computer is new and the battery is supposed to last between 5 to 8 hours on a lenovo flex 14.

  • Modify and add Profit Centre in S_ALR_87012078

    Hi, I have a requirement to modify S_ALR_87012078. Can someone tell me the way to copy this program and add the field on it...because when i see from the transaction code this program are using START_REPORT. Thanks.

  • [SOLVED] Offline Installation Help

    I'm new to Arch. It's just 2 days since I've downloaded the iso. I installed it and it worked really nice. However, I messed up the system trying out some experiments. Now I want to reinstall it. I have my /var/cache/pacman/pkg folder backed up. Is t

  • Remote DVD or CD Sharing

    I installed the DVD or CD Sharing software from the OS X install disk 1 on Vista. I enabled DVD or CD sharing via the control panel on Vista. I enabled allowing requests in Security/Firewall on the MBA. I put the DVD in the DVD device on the Vista. I

  • Safari & finder crash after waking up

    Hello, Since upgrade to 10.8, my iMac crash a few time around sleeping and waking up state, here an exemple : Aug 12 10:35:08 iMac-ofXXXXX kernel[0]: Ethernet [AppleBCM5701Ethernet]: Link up on en0, 100-Megabit, Full-duplex, Symmetric flow-control, D