Transfer Object in JSF, Spring, and Hibernate

The application on which I am working deploys the JavaServer Faces, Spring and Hibernate frameworks.
We are going to use the "transfer object" to move data between J2EE tiers from the front end to the back end and vice versa. In addition, data "types" may need to be converted --
At the front end, the "type" of the data that are entered by users may not match that in the database table. For example, checkboxes may be marked or left blank by users. The "type" of the checkboxes is "boolean" in the JSF backing bean. However, we have either "Y" or "N" for the corresponding field in the database table.
The JSF backing bean holds data as well as controller functionality. Of course, the transfer object holds data only.
With regard to class properties, Is the transfer object an exact copy of the JSF backing bean? And at which tier the data are converted to match their correspoding "types" in the database tables?
We also have the "data objects" which are exact representation of database tables.
Thanks for your advices.

Small example: you can decide in the business layer
whether to convert it to boolean or Boolean (which
has a 3rd state: null).But it all goes back to your data model. If your data model supports null for that property, then of course boolean is a poor choice. If that case one could use Boolean. None of this has anything to do with re-usability, which was your objection.
I think the re-usability question goes back to the data model as well. Suppose your data model says this property is boolean valued. However if your database does not support booleans natively, then you need to map the value for storage in the database. But that is the data persistence layers problem.
OTOH, suppose your data model says that this property may be 'Y' or 'N'. Then the Java class represent the business object should not have a boolean property, we should make it match the data model.
However, I think that most cases where people are storing 'Y' or 'N' in a field in the database fall into the first case, where the data model is a boolean and they are working around limitations in the database. There is no reason in that case to perpetuate the same limitations in the Java code.

Similar Messages

  • JSF, Springs and Hibernate

    Hi,
    I am a newbie. I would like to know the books i need to refer to, inorder to learn JSF, springs and hibernate.
    Thank you,

    The_Matrix wrote:
    CeciNEstPasUnProgrammeur wrote:
    How about learning Java first?
    At least for JSPs, there are free online tutorials from Sun. There are likely to be similar resources for Spring and Hibernate.I Know Java. I am a Sun Certified Java Programmer. I also know know J2EE. I am trying to learn the new technologies. Therefore i mentioned that i am a newbie, it was pertianing to JSF, Springs and Hibernate. Not to Java.In that case:
    Core Java Server Faces (2nd edition)
    Java Persistence with Hibernate
    Pro Spring 2.5
    Expert Spring MVC and Web Flow
    Together with the product documentation those should make a decent bit of reading.

  • Training material on JSF, Spring and Hibernate

    Hi All,
    I'm new to JSF. I need some good training material on JSF, Spring and Hibernate.
    I've tried lot many tutorials online, but cannot find a real good one.
    Also I need to learn how we can integrate together JSF, Spring and Hibernate to build web applications.
    Thanks
    Payal

    As far as documentation vs examples, that depends on the individual.
    The Spring documentation is quite large, but Spring itself is very modular. So you can pretty much get away with reading the pieces you need when you need them and ignoring the rest.
    Start with inversion of control until you feel you understand the concept. At its core, the idea is simple. Suppose you have a business class, FooService, and it needs to utilize BarService to implement its business logic. The non-Spring way would be to have the FooService class be responsible for getting an instance of BarService. The Spring way is for FooService to have a setter to be given an instance of BarService:
    public class FooServiceImpl implements FooService
        private BarService barService;
        public void setBarService(BarService barService) { this.barService = barService; }
    }Then the Spring container is used to "wire together" the instances:
    <beans>
        <bean id="barService" class="BarServiceImpl" />
        <bean id="fooService" class="FooServiceImpl">
            <property name="barService" ref="barService" />
        </bean>
    </beans>Note the advantage when using the classes in different contexts, e.g. unit testing vs production.
    If I were you, I would take the sample app you have already done with JSF and try to integrate Spring into it. Move all the business logic into beans in the Spring container while keeping the view logic in the JSF layer.

  • WebDynpro Importing Model as Spring and Hibernate

    hi guys,
    Can any one tell me clearly about how to import model(Spring and HIbernate) in WebDynpro for java
    Thanks & Regards
    RK

    Hi Ramakrishna,
    Spring and Hibernate is used for Database access instead of EJB.
    To import spring and Hibernate model Use Either <b> Import Adaptive Web Service Model </b> or <b> Import Java Bean Model </b> by right Click on Models.
    WebDynpro with Hybernate
    https://www.sdn.sap.com/irj/sdn/docs?rid=/webcontent/uuid/e081a4b6-0801-0010-7fa4-c3c7a0454815 [original link is broken]
    Regards,
    Mithu

  • How to use multiple datasource in spring and hibernate

    HI all,
    I want to use multiple data source for my web application.Please suggest me the mapping of xml files viz.
    applicationContext-resource.xml,applicationContext-hibernate.xml and applicationContext-service.xml
    SHoud i create separate session factory and transaction manager for both the datasource?
    Here is my applicationContext-resource.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
        "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    <bean id="dataSource" 
              class="org.apache.commons.dbcp.BasicDataSource">
              <property name="url" value="jdbc:oracle:thin:@192.168.x.x:1521:orcl"/>
              <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
              <property name="username" value="dw_lt_staging"/>
              <property name="password" value="dw_lt_staging"/>
    </bean>      
    <bean id="dataSourceAnalytics" 
              class="org.apache.commons.dbcp.BasicDataSource">
              <property name="url" value="jdbc:oracle:thin:@192.168.y.y:1521:orcl"/>
              <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
              <property name="username" value="dw_analytics"/>
              <property name="password" value="dw_analytics"/>
    </bean>            
    </beans>Thanks in advance.

    HI all,
    I want to use multiple data source for my web application.Please suggest me the mapping of xml files viz.
    applicationContext-resource.xml,applicationContext-hibernate.xml and applicationContext-service.xml
    SHoud i create separate session factory and transaction manager for both the datasource?
    Here is my applicationContext-resource.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN"
        "http://www.springframework.org/dtd/spring-beans.dtd">
    <beans>
    <bean id="dataSource" 
              class="org.apache.commons.dbcp.BasicDataSource">
              <property name="url" value="jdbc:oracle:thin:@192.168.x.x:1521:orcl"/>
              <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
              <property name="username" value="dw_lt_staging"/>
              <property name="password" value="dw_lt_staging"/>
    </bean>      
    <bean id="dataSourceAnalytics" 
              class="org.apache.commons.dbcp.BasicDataSource">
              <property name="url" value="jdbc:oracle:thin:@192.168.y.y:1521:orcl"/>
              <property name="driverClassName" value="oracle.jdbc.driver.OracleDriver"/>
              <property name="username" value="dw_analytics"/>
              <property name="password" value="dw_analytics"/>
    </bean>            
    </beans>Thanks in advance.

  • Spring and Hibernate.

    Hi
    Can someone please let me know why there is a need to integrate Hibernate with Spring. Sping provides JDBC templates to work with persistance storage so why use Hibernate.
    I know Hibernate is O/R Mapping framework. I need some concrete differences with what i can do with Hibernate and not with Spring.

    ...and the same can be done using JDO (in particular
    Kodo JDO), or Apache's OJB (ObJectrelational Bridge),
    integrated via Spring's ORM framework support.
    This is hardly a Hibernate-specific added value.Of course, but that's how the OP phrased the original question. Perhaps a better question would have read "JDBC versus other persistence strategies in Spring".
    If there are indeed some present issues with the
    application that could be addressed with
    lazy-loading, then the OP could look into
    different solutions ( of which Hibernate is only one
    ) to be integrated with the existing Spring
    framework,.The OP appears to be asking whether using straight JDBC with Spring is good enough, and what were reasons s/he hadn't considered for going with another persistence scheme.
    If there are no issues to address, then there is no
    need for such a thing.You're no better at reading their mind than I am. I just tried to answer the question as written.
    %

  • Realtime information and question of spring and hibernate?

    please send questions and answers.

    Hi Mike,
    I don't think, you will be able to retrieve the DPAYH\DPAYP data once it gets deleted SAP using the SAP program RFKPYD00.
    On a pro active basis, you can go for either of the following options-
    Option-1
    DPAYH/DPAYP contains payment data as well as exception data for the various payment runs.However, the main concern is the payment data, as it is the data that is sent to the bank.
    These payment data can be easily segregated from the exception data based on the field (DPAYH-GRPNO).
    So you  can create two custom  tables like DPAYH\DPAYP in IS-U and store only the payment data along with the relevant fields that you want to store for future references.
    You can update these custom tables during the processing of the payment medium job (creation of the file that is sent to bank),
    Option-2
    If your SAP IS-U system is connected to BW\BI, then you can also retrieve the  payment relevant data from the DPAYH\DPAYP tables in to BW\BI through a BW\BI extractor and then design a report which will give you the relevant details.
    Thanks,
    Amlan

  • Transfer Object Pattern and Concurrency Transaction Mgmt

    I am developing an application that implements a remote rich client. For
    performance reasons I have chosen to use the Transfer Object pattern. I
    have been very successful with this from a performance standpoint, it
    really paid off. I am using it in combination with an assembler pattern
    to construct Transfer Objects for the view and to also reassemble domain
    objects based on changes made to transfer objects on my client side.
    Anyways the only problem I am having with it is I can't seem to figure
    out how I should implement optimistic locking with it. Is there a best
    practices to handle transaction control here?
    I generally try to keep visibility of stale data down, but there are still
    situations where concurrent clients could have requested to edit the same
    the Transfer Object at the same time. I would ideally like to handle this
    using a flavor of optimistic locking. I in fact have implemented
    optimistic locking on the domain side, but now I am not sure how or if I
    should integrate this into the Transfer Object or View side. The version
    field used in optimistic locking is generally a hidden field. The only
    way I can see to handle this with the view side is to expose this field on
    the Domain Objects and actually store it into assembeled transfer objects.
    This seems like it may be a bad idea from a design standpoint.
    The problem is the client requests data and it assembled and delivered to the client. Then at some later time the client may send a request to the server to update this data. At this time a new transaction must be started where the server reloads the domain data and copies over the requested changes. Since the domain data was just loaded you wouldn't ever trigger a versioning problem unless the version was maintained on the transfer object and copied over as well. I am developing this project with hibernate on the back end and unfortunately hibernate doesn't acknowledge manual changes to the version field.
    I just feel like there must be a better way to do this. I believe that using the Transfer Object or DTO pattern for remote client/server architectures is pretty common. So there must be a best practice to deal with concurrency? Suggestions, insight, lay it on me please.
    thx

    I personal respect both concepts and am using both in an application I am currently work.
    Firstly, I have my Transfer Object which I call xxxData.
    Next, the entities are called xxx
    I have my DAO classes that handles all CRUD operation. but within the DAO class I have two methods
    private <EntityClass> retrieveEntityFromObject(<EntityClassData> data) {}
    private <EntityClassData> retrieveEntityFromObject(<EntityClass> entity) {}so with these methods, I separate my business logic from my data layer. My codes will alway use data objects instead of entities. For example, a create method will be
    public ProductData createProduct(ProductData data)
         entity.persist(retrieveEntityFromObject(data));
    }I hope someone understands
    Regards

  • How is the processing speed while using struts,spring,and JSF framework

    Hi friends,
    As per earlier technology like Servlets,I mean that there would have much more performance speed than other new technologies like JSP,struts,spring and hibernate framework.Because,in new technologies,flow of processings implicitly via MVC2 basis will probably much more time than older one.
    Total goal is only for attaining MVC2 or any other purpose?
    Please clarify my doubt?
    With Regards,
    Stalin.G

    Home grown applications have a problem in that as more and more features are added, it becomes increasingly impossible to maintain the application and enhance it. This is especially true when the original programmers leave the company. A framework provides a standard design approach that other programmers can hopefully more easily pick up.
    A lot of work has gone into creating these frameworks and they have been used in web sites that have millions of hits from users per day. They have high preformance. Of course, programmers can still write bad code in them that slows down the system. I believe anyone using these frameworks should study them well before using them (such as reading books on them).

  • Must I use spring Framework with JSF2 and Hibernate?

    Hi all,
    I'm starting to develop a web portal and I would use JSF2 and Hibernate.
    Now I don't know JSF2 so I searched some tutorial.
    I found a tutorial on JSF2 that seems very complete but in this tutorial I found a section where the author use Hibernate for the "model section", JSF2 for the "view section" and Spring for the "controller section"!
    Now I have a doubt, can I develop a web portal without Spring MVC or I can't develop any controller's component with JSF2?
    Thank you for your replies!

    For Ram, do you mean that JSF2 isn't a MVC framework with your reply?
    For Kayaman, the author did some examples how implements some frameworks with JSF2 and he do 3 examples:
    1) JSF2 and JDBC;
    2) JSF2 and Spring;
    3) JSF2, Spring and Hibernate!
    However, after this thread, I found a forum in linked to the tutorial and I asked why they use JSF2 and Spring together! Now Im waiting the answer!
    For Gimbla2: well, I'm novice on JSF2 but I develop for some years with ADF and JBO framework!
    You are right to tell me "On the official sites you can find all informations" but I would know some things from some one that used both frameworks!
    Thanks again to all.
    Edited by: Filippo Tenaglia on 20-giu-2011 14.16

  • Regarding Spring an hibernate as WebService

    Dear All
    I need to develop a Webservice with Spring and Hibernate and need to import 
    as Java Bean Model in NWDS!
    Does any body have small application Source code to develop spring and Hibernate as Webservice?
    or let me know how to proceed ?
    Thanks
    Shravan

    Hi Shravan,
    first of all I am wondering about the usage scenario. Why do you want to develop with Hibernate and Spring and then convert it to EJB? How about directly starting with EJBs. Developing Web Services based on EJB is pretty straightforward in NWDS. Even simpler if you are using Enterprise Service Builder to generate the wsdls.
    If you want to stick with your choice I would recommend you to have a look on the official spring website. There are a lot of tutorials and samples for all components of spring, including web services: [http://static.springsource.org/spring-ws/sites/1.5/reference/html/tutorial.html|http://static.springsource.org/spring-ws/sites/1.5/reference/html/tutorial.html].
    Kind Regards,
    Carl Heckmann

  • 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.

  • JSF - spring - hibernate and session

    Hi,
    I'm currently using hibernate spring and JSF
    1/ the first problem
    In the JSF common header page I try to test if a bean is in the session scope in order to show login or logout link, and the test always fails : the logout link is always displayed.
    the JSF page :
    <f:subview id="header" >
        <h:form id="headerForm">
            <table cellspacing="0" width="100%">
        <tr>
            <td align="left" valign="middle">
                  <a href="front.jsf"><img border="0" src="images/logo1.jpg"/></a>
            </td>
        <td align="right" valign="middle"> <br>
       <!--<a href="front.jsf" rendered="#"> Accueil<</a> -->
        <c:choose>
                    <c:when test="${empty sessionScope.accountBean}">
                        <h:commandLink action="Sign on">
                            <h:outputText value="Sign on"/>
                        </h:commandLink>  
                    </c:when>
                    <c:otherwise>
                        <h:commandLink id ="logout" action="#{accountBean.logoutAction}" >
                             <h:outputText value="log out"/>
                        </h:commandLink>
                   </c:otherwise>
                </c:choose>
            </td>
        </tr>
    </table>
    <table cellspacing="0" width="100%">
        <tr>
            <td>
                <hr color="#99ca3c"  size="5" noShade SIZE=1>
            </td>
        </tr>
    </table>
         </h:form>
    </f:subview>The accountBean code :
    public class AccountBean extends BaseBean{
    //private Logger log = Log.getLog(this);
        private String uid;
        private String password;
        private boolean loggedIn;
        private AdminService adminService;
        private Admin admin;
        public AccountBean() {
            this.logger.debug("Authentication");
            this.loggedIn = false;
            uid=null;
            password=null;
           // admin=new Admin();
    public String loginAction() {
              try {
                        this.logger.debug("loginAction");
                         admin = adminService.login(this.uid, this.password);
                                    //this.serviceLocator.getUserService().login(this.username, this.password);
                   if (admin != null) {
                                if("".equals(admin.getUid())|| "".equals(admin.getPassword())){
                                 this.loggedIn=false;
                                    String msg = "Le mot de passe et l'identifiant doivent etre saisis ";
                        addErrorMessage(msg + ", saississez un mot de passe et un identifiant corrects");
                                 return NavigationResults.RETRY;
                                else{
                        this.loggedIn = true;
                                    HttpSession session = SessionUtil.getSession();
                                    session.setAttribute("Admin", this.uid);
                        return NavigationResults.SUCCESS;
                   else {
                        this.loggedIn = false;
                        String msg = "Le mot de passe est incorrect ";
                        addErrorMessage(msg + ", saississez un mot de passe correct");
                        this.logger.debug(msg);
                        return NavigationResults.RETRY;
              catch (UsernameNotExistException ue) {
                   String msg = "L'identifiant (login) est incorrect";
                   this.logger.info(msg);
                   addErrorMessage(msg + ", ressaysissez votre identifiant.");
                   return NavigationResults.RETRY;
              catch (Exception e) {
                   this.logger.error("Could not log in user.", e);
                   addInfoMessage("Could not log in user: Internal Error");
                   return NavigationResults.FAILURE;
          * The backing bean action to logout a user.
          * @return the navigation result
         public String logoutAction() {
              //this.clear();
               FacesContext fc = FacesContext.getCurrentInstance();
               HttpSession session = (HttpSession) fc.getExternalContext().getSession(false);
               session.invalidate();
              this.logger.debug("Logout successfully.");
              return NavigationResults.MAIN;
        public String getPassword() {
            return password;
        public void setPassword(String password) {
            this.password = password;
        public String getUid() {
            return uid;
        public void setUid(String uid) {
            this.uid = uid;
        public Admin getAdmin() {
            return admin;
        public boolean getLoggedIn() {
            return loggedIn;
        public void setLoggedIn(boolean loggedIn) {
            this.loggedIn = loggedIn;
        public void setAdminService(AdminService adminService) {
            this.adminService = adminService;
    }the faces managed bean configuration
    <managed-bean-name>accountBean</managed-bean-name>
        <managed-bean-class>fr.cbmjadmin.views.bean.AccountBean</managed-bean-class>
        <managed-bean-scope>session</managed-bean-scope>
        <managed-property>
         <property-name>adminService</property-name>
                <value>#{adminService}</value>
        </managed-property>2/ the second problem :
    my application shows a list of datas.
    I log on the application , i update this list outside the application ( by using sql command) , i try to list my data using the application : the application does not reflect the modifications. I logout using the log out link, then i log on and the application does not reflect the modifications.
    what happens?
    How could I resove these problems.
    How can i logout properly?
    how can i show logout link when the user is logged in? and hide the log out link when the user is logout
    Thanks.

    It depends on how you want to reprecate the session btwn instances or cluters
    there are three kinds File System, Memory to Memory, HA
    You can configure it from this property in the admin console
    Configuration on a cluster -> Availability Service -> Web Container Availability -> Persistence Type:

  • Help me out with Directory structure for JSF+SPRING+HIBERNATE Project

    Hi frnds ,
    My name is Walter working for a startup software company . We are working on Hospital Management System (HMS) project .. MVC Architecture ...using Hibernate Spring and JSF ..we need to design Directory Structure for our project..
    plzz help me friends in suggesting MVC Directory structure ...? also plzz help me by directing me with the navigation flow?
    Thnxx in advance
    Regards
    Walter

    Thank you so much .. friends ..for your kind replies..thanks to Illu, anguquga and special thanks to BalusC for giving me the advice for hiring EE Artitech ..
    Anyways I have discussed with my teammates designing the directory structure
    anguquga your directory structure is close to what I have designed ..referiing to a sample application on web..
    Hospital Management system MVC architecture Directory structure
    This is the way the structure goes on ..
    model --> for Hibernate as well as Spring
    View --> for JSF
    src(-)
    |
    ------(-) java
         |
         -------(-) model
              |
              ------(+) businessobject
              |
              ------(-) dao
              |
              ------(+) hibernate
              |
              ------(+) exception
              |
              ------(-) service
              |
              ------ (+) impl
              |
              ------(+) util
              (-) view
              |
              ------(+) bean
              |
              ------(+) builder
              |
              ------(+) bundle
              |
              ------(+) servicelocator
              |
              ------(+) util
              |
              ------(+) validator
    (-) Web or WebRoot
    |
    ----- (-) JSP Files�etc.,
    |
    ----- (-) META-INF
    |
         ------     (+) Images
    |
         ------     (+) Scripts ==== CSS (cascading style sheets, JavaScript files etc.,)
    |
    ----- (-) WEB-INF =========xml files web.xml, faces-config.xml etc.,
         |
         -----(-) Classes
              |
    -----(-) HMS
    |
                   ----- (+) model
                   |
                   ----- (+) view
    |
    ----- (+) lib
    I am sure you may notice few errors .. if u find any plzz reply me back.... thnxx in advance for replies...and thnxx for giving your valuable replies...
    Walter (Kaleem)

  • How to combine Session Facade and Transfer object?

    Hello All!
    I'm working on an enterprise application. Presentation layer is a stand alone client, business logic is build on the Glassfish v2.1 and MySQL is used as a database. The client is connection to the GlassFishj server remotely using EJBs.
    I have problems with business logic architecture.
    Here is the brief description of backend application architecture design:
    1. Session Facade pattern is used to simplify the client and application server interface and to provide application layers between backend (http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html).
    2.Transfer Object pattern to define update transfer objects strategy in order to decrease network overhead during client and application server interactions and to provide version control for objects. Transfer objects are designed as simple java business serializable objects. (http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html)
    3. Originally the backend application consisted of three modules: users, storage and orders, but at the end I have decided to divide my application into the following parts - assortments, map, menu, orders, transactions, users.
    4. All MySQL database transactions are via JDBC using procedures. No use of entity beans.
    Questions:
    1. I have some doubts about using Session Facade and Transfer object patterns at the same time. At first I'd mike to cite the definitions of the patters from the SUN official web site.
    * Use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow. The Session Facade manages the business objects, and provides a uniform coarse-grained service access layer to clients.
    * Use a Transfer Object to encapsulate the business data. A single method call is used to send and retrieve the Transfer Object. When the client requests the enterprise bean for the business data, the enterprise bean can construct the Transfer Object, populate it with its attribute values, and pass it by value to the client.
    * So, if I use Transfer Object along with Session Facade, it makes some difficulties with object version control, because I 2 or
    3 transfer objects controls with the 1 bean class. The best option for Transfer object Pattern is that each transfer object should have its own bean class to provide ability of object's version control. In the case it can bring the network overhead because of frequent remote calls caused by the large number of the bean classes.
    * So, should I use the both patterns? If yes, how to manage the interaction the patterns. If no, which one to use.
    2. E.g. I have a huge list of the Order objects and each Order object consists of other complicated objects. So, would I have trouble to transfer that list over network? If yes, how to manage it.
    Thank you!
    Astghik

    Astghik wrote:
    Hello All!
    I'm working on an enterprise application. Presentation layer is a stand alone client, business logic is build on the Glassfish v2.1 and MySQL is used as a database. The client is connection to the GlassFishj server remotely using EJBs.
    I have problems with business logic architecture.
    Here is the brief description of backend application architecture design:
    1. Session Facade pattern is used to simplify the client and application server interface and to provide application layers between backend (http://java.sun.com/blueprints/corej2eepatterns/Patterns/SessionFacade.html).
    I would simply recommend establishing a service tier. Your services should be stateless. You can go the extra mile and have a session facade, but in the majority of cases, coding to an interface for your service accomplishes the same goals.
    2.Transfer Object pattern to define update transfer objects strategy in order to decrease network overhead during client and application server interactions and to provide version control for objects. Transfer objects are designed as simple java business serializable objects. (http://java.sun.com/blueprints/corej2eepatterns/Patterns/TransferObject.html)
    The idea of the transfer object is very similar to the Command pattern. I think if you investigate that pattern, it will be more obvious. The transfer object reduces network latency by consolidating all the parameters into an object, ideally, this also consolidates multiple method calls. If you combine a transfer object (or command object) with a service tier, you get the best of both worlds. The service can delegate calls to helper objects (or other services or components) using the data in the transfer / command object.
    3. Originally the backend application consisted of three modules: users, storage and orders, but at the end I have decided to divide my application into the following parts - assortments, map, menu, orders, transactions, users.
    The is your domain. It will vary from application to application. The principles above are more general (e.g., patterns and architectural tiers) and should apply to most domains. However, your actual use case may require something different.
    4. All MySQL database transactions are via JDBC using procedures. No use of entity beans.
    Consider using something like iBatis or Spring's JDBC templating to make your life easier with JDBC.
    Questions:
    1. I have some doubts about using Session Facade and Transfer object patterns at the same time. At first I'd mike to cite the definitions of the patters from the SUN official web site.
    * Use a session bean as a facade to encapsulate the complexity of interactions between the business objects participating in a workflow. The Session Facade manages the business objects, and provides a uniform coarse-grained service access layer to clients.
    * Use a Transfer Object to encapsulate the business data. A single method call is used to send and retrieve the Transfer Object. When the client requests the enterprise bean for the business data, the enterprise bean can construct the Transfer Object, populate it with its attribute values, and pass it by value to the client.
    * So, if I use Transfer Object along with Session Facade, it makes some difficulties with object version control, because I 2 or
    3 transfer objects controls with the 1 bean class. The best option for Transfer object Pattern is that each transfer object should have its own bean class to provide ability of object's version control. In the case it can bring the network overhead because of frequent remote calls caused by the large number of the bean classes.
    * So, should I use the both patterns? If yes, how to manage the interaction the patterns. If no, which one to use.
    Versioning is a separate issue. Generally, the more coarsely grained your transfer / command object is, the more changes are likely to impact dependent objects.
    Your command or transfer object does not have to be a vanilla JavaBean, where you are basically creating a bean that has data from other objects. You can simply use your command / transfer object to encapsulate already existing domain objects. I see no need to map to a JavaBean with what you have described.
    Generally, a method signature should be understandable. This means that many times it is better to pass the method, say, two coarsely grained objects than a signature with a dozen primitives. There are no hard and fast rules here. If you find a method signature getting large, consider a transfer / command object. If you want one service to delegate calls to a number of other services, you can also create a transfer / command object to furnish the controlling service with the data it needs to invoke the dependent services.
    2. E.g. I have a huge list of the Order objects and each Order object consists of other complicated objects. So, would I have trouble to transfer that list over network? If yes, how to manage it.
    This is a large, open-ended question. If you are going to display it to a user on a screen, I do not see how you avoid a network transfer with the data. The general answer is to not pass the data itself but rather a token (such as a primary key, or a primary key and a start and stop range such as you see on a Google search result). You do want to limit the data over the network, but this comes at a cost. Usually, the database will receive additional load. Once that becomes unacceptable, you might start putting things into session. Then you worry about memory concerns, etc. There is no silver bullet to the problem. It depends on what issues you are trying to address and what trade-offs are acceptable in your environment.
    Thank you!
    AstghikBest of luck.
    - Saish

Maybe you are looking for

  • How can I change to a different user on iPad

    How can I change to a different user on iPad, please help!

  • Editor not working in Photoshop Elements

    In April I purchased Photoshop Elements after having it as a trial. The editor part has now stopped working,When trying to upload image to editor, box pops up with trial version, when I cancel this it just stays in organiser. I notice that the editor

  • Erro in MIGO

    Hi, I am doing MIGO  with reference of purchase order and getting error. Sales price for  000000000000000694   could not be found     Message no. M7158 Diagnosis     The sales price valuation is active in the valuation area.     The system could not

  • #text nodes

    Hello, I am parsing xml document using xerces with schema validation on, without DTD. <xs:element name="variant"> <xs:complexType> <xs:sequence> <xs:element ref="ds:default"/> <xs:element ref="ts:answer"/> </xs:sequence> </xs:complexType> </xs:elemen

  • Export to Quicktime with alpha channel

    I'm trying to export my Keynote project to a Quicktime video with a tranparent background.  I set my slide backgrounds to None. In the export panel I've selected the "User Transparency" option and under Custom settings I've selected Animation with Mi