Data Transfer Objects Design Pattern

Hi All,
Could anyone tell me more about this DTO design pattern, as such when one should prefer it.
Second is this pattern transaction safe or one would have to implement the same manually. Any updates would prove benefecial to me.

Hi
I do not understand what you mean.
A dto is just an object which you populate in one layer and use in another layer.
you do not need any jndi look for DTO , instead you lookup for ejbs , datasources ,....
for example you lookup for some CMP , search and find some CMPs , populate DTO with those CMP and send the DTO to front layer.
if it is not the answer , can you explain more about your requirements(S)

Similar Messages

  • ABAP objects design patterns

    hi all,
        can any one send me the Design patterns used for ABAP objects programming in ABAP. eg mvc and sample code which uses the design patterns
    cheers
    senthil

    Of course that program is not an object design pattern
    (Its just a little ABAP Objects syntax demo that I wrote  years ago
    I don't know about a list of OO design patterns implemented in ABAP Objects.
    A very simple one, a Singleton might look like this:
    <b>* cl_singleton: Eager Variant
    CLASS cl_singleton DEFINITION FINAL
                                  CREATE PRIVATE.
      PUBLIC SECTION.
        CLASS-METHODS: class_constructor,
                       get_singleton RETURNING VALUE(singleton)
                                               TYPE REF TO cl_singleton.
      PRIVATE SECTION.
        CLASS-DATA singleton TYPE REF TO cl_singleton.
    ENDCLASS.
    CLASS cl_singleton IMPLEMENTATION.
      METHOD class_constructor.
        CREATE OBJECT singleton.
      ENDMETHOD.
      METHOD get_singleton.
        singleton = cl_singleton=>singleton.
      ENDMETHOD.
    ENDCLASS.
    cl_singleton: Lazy Variant
    CLASS cl_singleton DEFINITION FINAL
                                  CREATE PRIVATE.
      PUBLIC SECTION.
        CLASS-METHODS get_singleton RETURNING VALUE(singleton)
                                              TYPE REF TO cl_singleton.
      PRIVATE SECTION.
        CLASS-DATA singleton TYPE REF TO cl_singleton.
    ENDCLASS.
    CLASS cl_singleton IMPLEMENTATION.
      METHOD get_singleton.
        IF cl_singleton=>singleton IS INITIAL.
          CREATE OBJECT cl_singleton=>singleton.
        ENDIF.
        singleton = cl_singleton=>singleton.
      ENDMETHOD.
    ENDCLASS.</b>

  • Business Objects(BOs) & Data Transfer Objects(DTOs)-both needed ?

    In a J2EE system...
    I know that "Business Objects" (BOs) are basically value objects (VOs) ...lots of getters and setters and some business logic. These are basically to model nouns in the system. Eg Student BO.
    I know that "Data Transfer Objects" (DTOs) are value objects (VOs)....with getters and setters... with the purpose of avoiding multiple method calls...to avoid overhead...which effects performance. eg it's better to pass a Student DTO then say...pass the student ID and student name and student age etc etc.
    Main question : Should a system have both ? If yes, why do I need a StudentBO.java and then another StudentDTO.java....when they are so similar ?...when both are basically VOs ? Can't I just use BOs to serve as DTOs ?
    Thanks.

    Hi,
    I've started using BO's and DTO's since 3 months .With my experiece i understand we nned both of them.
    The BusinessObject represents the data client. It is the object that requires access to the data source to obtain and store data.
    DTO
    This represents a Transfer Object used as a data carrier. The DataAccessObject may use a Transfer Object to return data to the client. The DataAccessObject may also receive the data from the client in a Transfer Object to update the data in the data source.
    From this i want to tell you that We are not gonna do any operation on BO's but we do operations on DTO
    Ashwin

  • Simple Question - Data Transfer Object

    Hey gurus,
    I like the option in JBuilder to automatically create Data Transfer Objects and an Assembler for it. But what? I used to make the assembler a Session Bean, and JBuilder makes it a normal Java class with static methods. I know JBuilder always ships with the best solutions, but...
    what is the advantage of the static class here? And in my case, i have the session beans and the entity beans deployed on a different server, would that make a difference for the advantage?
    greets,
    Nick.

    Hey gurus,
    I like the option in JBuilder to automatically create
    Data Transfer Objects and an Assembler for it. But
    what? I used to make the assembler a Session Bean,
    and JBuilder makes it a normal Java class with static
    methods. I know JBuilder always ships with the best
    solutions, but...
    well....... not always
    :-)

  • Data Transfer Object Class

    HI, i'm new with the web dynpro,  so i been told to use java web dynpro  using the Data Transfer Object, with a conection to Oracle.
    anybody has information about the web dynpro using Data Transfer Object.
    thanks in advance!!

    Hi,
    Their are lot of articles on the same here, please search for java bean models. Will give some hints
    I guess what you are planning to do is
    DB--> EJB/POJO--
    > Webdynpro
    Regards
    Ayyapparaj

  • Data Transfer Objects

    Is it safe to assume that Data Transfer Objects should be populated by Business Objects that are local to entity beans or whatever is being used to populate them?

    jschell wrote:
    ttb999 wrote:
    jschell wrote:
    So if the point of DTOs is to reduce network traffic, why would you initially populate them using a remote object? That doesn't have anything to do with what I said.Well that was the jist of my question.Your statement has a historical perspective which probably doesn't mean much in current DTO usage.
    Originally RMI was promoted as a a 'method' interface. As such you would have had the equivalent of a DTO with setter/getter for each attribute. Each setter/getter would invoke a remote procedure call to the server.
    Thus a data object with 5 attributes would cause 5 network calls to 'populate' the attributes.
    That was vastly inefficient.
    Consequently the first DTO type (which was not called a DTO) was promoted as a way to avoid that.
    If you want you can look up "Remote Procedure Call" (RPC) which would have been the origin of where the 'method' idiom originated.And quite apart from performance, populating a local object from the remote prevents disruption of the local data in case the network connection is (temporarilly) lost.

  • Data Lista Handler Design Pattern and paging queries

    I'm using Toplink in an MVC (Regular Beans, JSP and Struts) application. I'm not using ADF. At least not until i make up my mind on the features-portability tradeoff.
    Anyway, my application will have to use queries to show the data to the user. This can easily be accomplished by putting the search parameters on my jsp and using ReadAllQuery to compose my query.
    My problem is that the result can return a large amount of records and show all this records at once on the jsp might take a time the user won't be willing to wait. That's when paging the results will come handy.
    In another application of mine i use paging manipulating the rownum of the query, but in that case, i had control of the whole sql statement. As this is the first time i'm working with Toplink, i'm feeling that can't be done.
    There's the Data List Handler design pattern too, but that one also manipulates the sql statement.
    I'm wondering now whether paging can be accomplished using Toplink..? Will i have to use ADF...? This kind of stuff.
    Thanks a lot to all.
    - Eduardo

    Eduardo,
    What you need to do is use Cursors in TopLink.Scrollable cursors enable you to scroll through a result set from the database without reading the whole result set in a single database read. The ScrollableCursor class implements the Java ListIterator interface to allow for direct and relative access within the stream. Scrollable cursors also enable you to scroll forward and backward through the stream.
    Here is an example:
    ReadAllQuery query = new ReadAllQuery();
    query.setReferenceClass(Employee.class);
    query.useScrollableCursor();
    ScrollableCursor cursor = (ScrollableCursor) session.executeQuery(query);
    while (cursor.hasNext()) {
    System.out.println(cursor.next().toString());
    cursor.close();
    I hope this answers your question.
    Deepak

  • Hierarchical data transfer objects confusing Flex compiler...

    I just posted this same query on FlexCoders... but then I
    thought this might be a better target group to ask, so here goes:
    We are working on a set of data transfer objects where we
    have matching server-side java classes and client-side AS classes.
    Some of these DTO contain lists of other DTOs. As an example:
    A.java:
    public class A {
    List<B> blist
    In A.as we have...
    class A {
    public var blist : ArrayCollection;
    And we have B.java and B.as
    Then we have a RemoteObject call to pull down a bunch of A
    objects....
    Here's the problem, Flex does not compile B.as at build-time.
    So if B.as has a compiler problem, you never know about it,
    except that the 'blist' in A never gets populated. If you break
    down the data transfer and debug it. You find that during
    RemoteObject call, the blist data comes "down the wire", but as an
    ArrayCollection generic Objects, they never get turned into
    instances of Bs...
    I am guessing that this is happening because at compile time,
    there is not direct reference to B in the clientside project. Our
    covering .mxml wants one or more A objects, and inside A the blist
    is an ArrayCollection. So the compiler doesn't see a reference to
    B..
    So anyone know how we can fairly seamlessly make sure B.as
    gets compiled at build time so we'd know of compiler issues with it
    rather than spending lots of time debugging mysterious null values?
    (This appears to happen whether the project is set to compile
    on the client-side or the server-side. We are using Flex and FDS
    2.0.1 and Java 1.5)

    up...

  • DAO object Design Pattern

    i have to develop a web base applecation which is database indepandent, to achive this functionlity i have to use DAO design pattern.
    can some one explane me more about this............................

    Data Access Object:
    Java BluePrints - Data Access Object
    JavaWorld: Write once, persist anywhere

  • Data Transfer Application Design

    Hi,
    I am designing a data transfer application.
    Source of the application is a perl script retrieving the data from the database.
    Destination of data is an application which has a Java web service interface.
    I want a solution to bridge the two.
    How should i feed the data accessed in the perl script to the destination application via the exposed java web service

    Hi,
    I am designing a data transfer application.
    Source of the application is a perl script retrieving the data from the database.
    Destination of data is an application which has a Java web service interface.
    I want a solution to bridge the two.
    How should i feed the data accessed in the perl script to the destination application via the exposed java web service

  • Can I declare arraylists in data transfer object

    Can I use arraylists in data transfer objects

    Yes, and don't double post:
    http://forum.java.sun.com/thread.jsp?thread=540027&forum=425&message=2616354
    Answers don't always come in three minutes. Be patient.

  • Adobe Flex + PHP (Using Data Transfer Object pattern in amf)

    hello
    i'am using amf to connect my flex application to the php back end,but i want to use DTO(DataTransferObject), i haven't enough info about this pattern.
    can you introduce me a reference or have you any suggestion?
    thanks for your attention
    Uniqe_max (amin shahnazary)

    here is another way of doing it
    http://www.youtube.com/watch?v=1n1uHQAP18Q
    http://www.youtube.com/watch?v=fQsCBk9tvkQ

  • User-Defined Data Type (Data Transfer Objects) is null

    hi
    i try to access a nested complex datatype over blazeds. i always see that the second level of the  complex datatye is NULL but the other data's like String are ok.
    here an example:
    as you can see TT1 has a member TT2, and a String
    TT2 has a member TT3 and a string
    and TT3 has just a string.
    in the ActionScript the TT2 referenz in TT1 is always NULL.
    Java Code
    Java code:
    package clientreportingserver;
    public class TT1 {
        public String getT1s() {
            return t1s;
        public void setT1s(String t1s) {
            this.t1s = t1s;
        String t1s;
        public TT2 getTt2() {
             return tt2;
        public void setTt2(TT2 tt2) {
             this.tt2 = tt2;
        TT2 tt2;
    =================================================
    package clientreportingserver;
    public class TT2 {
        public String getT2s() {
            return t2s;
        public void setT2s(String t2s) {
            this.t2s = t2s;
        String t2s;
        public TT3 getTt3() {
             return tt3;
        public void setTt3(TT3 tt3) {
             this.tt3 = tt3;
        TT3 tt3;
    =================================================
    package clientreportingserver;
    public class TT3 {
         public String getT3s() {
            return t3s;
        public void setT3s(String t3s) {
            this.t3s = t3s;
        String  t3s;
    ActionScript DataType
    package clientreporting.model
    import mx.collections.ArrayCollection;
    [RemoteClass(alias="clientreportingserver.TT1")]
    [Bindable]
    public class TT1
        public var t1s:String;
        public var t2:TT2
    ====================================================================
    package clientreporting.model
    import mx.collections.ArrayCollection;
    [RemoteClass(alias="clientreportingserver.TT2")]
    [Bindable]
    public class TT2
        public var t2s:String;
        public var t2:TT3
    ===================================================================
    package clientreporting.model
    import mx.collections.ArrayCollection;
    [RemoteClass(alias="clientreportingapi.TT3")]
    [Bindable]
    public class TT3
        public var t3s:String;
    here the output from blazeds. for me it looks perfect, all data are transmitted
    BlazeDs output
    [BlazeDS]Deserializing AMF/HTTP request
    Version: 3
      (Message #0 targetURI=null, responseURI=/5)
        (Array #0)
          [0] = (Typed Object #0 'flex.messaging.messages.RemotingMessage')
            source = null
            operation = "getTT"
            destination = "exposedServiceWrapper"
            clientId = "E57066B1-170E-503A-D4EC-004166E95FC3"
            body = (Array #1)
            timeToLive = 0
            headers = (Object #2)
              DSEndpoint = "channel-amf"
              DSId = "E570490A-C218-4A29-4229-8CD6F29222FC"
            timestamp = 0
            messageId = "5FDB47AD-9066-DD95-4CD4-0CE0D3F6C337"
    [BlazeDS]Adapter 'java-object' called 'null.getTT(java.util.Arrays$ArrayList (Collection size:0)
    [BlazeDS]Result: 'clientreportingserver.TT1
      t1s = TT 1 String
      tt2 = clientreportingserver.TT2
        t2s = TT 2 String
        tt3 = clientreportingserver.TT3
          t3s = TT 3 String
    [BlazeDS]Serializing AMF/HTTP response
    Version: 3
      (Message #0 targetURI=/5/onResult, responseURI=)
        (Externalizable Object #0 'DSK')
          (Typed Object #1 'clientreportingserver.TT1')
            t1s = "TT 1 String"
            tt2 = (Typed Object #2 'clientreportingserver.TT2')
              t2s = "TT 2 String"
              tt3 = (Typed Object #3 'clientreportingserver.TT3')
                t3s = "TT 3 String"
    1.262936445958E12
    (Byte Array #4, Length 16)
    (Byte Array #5, Length 16)
    (Byte Array #6, Length 16)
    the last Alert (accessing t2) got always a null pointer, the fist Alert works fine and print out the string i expected to see
    call in ActionScript
        public function loadTT():void {
           _policyService.getTT(loadTTHandle);
        private function loadTTHandle(content:TT1):void {
           Alert.show("" + content.t1s);
           Alert.show("" + content.t2.t2s);
    is it possible to access a nested complex type? i only could find simple examples.
    thanks for your help joe

    I found the problem
    in the flashlog.txt i found :ReferenceError: Error #1056: Cannot create property AFoo on [...]
    this let me to this blog http://blog.comtaste.com/java/  ==>
    Automating  ActionScript 3 classes generation from Java Beans in a LiveCycle Data Services context
    it was a naming problem.

  • Flex - Java Data transfer objects. How do you usually work ? (Brainstorming)

    Hi,
    I would like to explain you how I work and to know how you guys do.
    All this discussion is just an example of how I work. I really want to know how other coders usually work. This way, maybe I can improve my code.
    I would like to know how do you do when you want to retreive data into typed objects when these data contains reference to other typed objects.
    Here is how I always work :
    I want to retreive all my customers into a flex datagrid and to display all information.
    Here is my Customer table structure (just an example)
    id, name, refCompany, refLanguage, refCountry, refCustomerGroup
    refCompany, refLanguage, refCountry, refCustomerGroup are IDs that reference to other tables.
    To ensure to retreive all data into typed object, I make a Customer,Company, Language, Country, CustomerGroup, Flex and Java classes.
    I make a query that looks like : Select * from Customer
    My java code will looks like :
    List<Customer> customers = new ArrayList<Customer>;
    ResultSet rs = myConn.execSelect(query);
    while(rs.next)
         customers.add(new Customer(rs))
    return customers;
    In my Customer class, I have a constuctor that takes a resultSet
    My customer class contains variables (refCompany that is actually a Company object (not an id), refLanguage that is actually a Language object (not an id),... )
    Customer(ResultSet rs)
         this.name = rs.getString("name")
         this.refCompany = new Company.findById(rs.getInt("refCompany"))     //This function returns a Company object
         this.refLanguage = new Language.findById(rs.getInt("refLanguage"))     // This function returns a Language object
    Here is how I always do. I don't know if it is a good way because for each customer found in the database, I will make 4 queries (4 findById to find each object : company, language, country, customerGroup of the current customer).
    But this way is generic, I don't have to make a specific query that will retreive all objects in one time. I select all customers, and in the constructor I select all objects that I have the reference...
    The big problem with this way is when I retreive objects, I always retreive all referenced objects and I do not necessarily want it.
    What do you think about the way I work ? How you guys do ? what is the best practice ?

    up...

  • Data Access Object (DAO) pattern

    Can anybody provide some real-world implementation examples of the DAO pattern?
    I already looked at Sun's Java Petstore. They use DAO only for read-only database queries.
    DAO: http://jinx.swiki.net/282

    DAO's are basically meant for read only.The other purpose is to develop support for multiple databases in parallel.
    1. Interface
    public interface UserDAO {
    public void attachUserToRole();
    2. Class for Oracle
    public void attachUserToRole()
    //provide implementation here
    3. Class for SQLserver
    public class UserMSSqlDAOImpl extends MSSqlDAO implements UserDAO {
    public void attachUserToRole()
    //provide implementation here
    4. Class for any other database u wish
    5. DAO Factory
    public class UserDAOFactory {
    public static UserDAO getDAO() {
    int daoType = DatabaseTypes.getInstance().getDatabaseType();
    if (daoType == DatabaseTypes.ORACLE)
    return (UserDAO) new UserOracleDAOImpl();
    if (daoType == DatabaseTypes.MS_SQL)
    return (UserDAO) new UserMSSqlDAOImpl();
    return null;

Maybe you are looking for

  • 1st gen ipod touch locked out while installing ipod 2.0

    2008-07-15 01:43:58.092 iTunes.exe[4676:590]: unable to open C:\Documents and Settings\All Users\Application Data\Apple Computer\iTunes\iPod Temporary Files 8\Firmware\device_map.txt: No such file or directory 2008-07-15 01:49:12.994 iTunes.exe[4676:

  • Split a Shipment costs document into several MM document by carrier

    Hi gurus, I am trying to split a Shipment costs document into several MM document by carrier. We need the system to search for an existing MM order if not found create a new one (the system is set to do it by V_TVFT-BESER value “A”). I have a route w

  • User authentication in a transparent deployment

    Hi all, Just wondering, if I don't want to have to change anything on my browser in terms of proxy settings, is there any way for me to set up IronPort so that I can build policies per user (with Active Directory)? Basically I want policies as granul

  • Connectivity of Nokia 6020

    I have bought to connection cables for Nokia 6020, the first was a DKU2, the pc would not recognise this. The second cable is 7210, the pc recognises the connection but I cannot find a driver for this. Any help would be appreciated Roki

  • ADF/Struts Generated tag code variations? Struts html:text vs Html input

    Hi, JDev 10.1.2.1 ADF/Struts I noticed that the JDev IDE generates different code for a same component/binding combination. Example:Data Control of type Input form with same VO selection. Generated code for 1 field: case 1) JSP code: <tr> <td> <c:out