Announcement Announcement Module
Collapse
No announcement yet.
NewBie: SpringFacade in SwingClient Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • NewBie: SpringFacade in SwingClient

    Hello everyboy.

    WeŽve decided do integrate Spring and Hibernate in our Application and now some architectural Questions occured. IŽbe already read a lot about a Facade managing the requests and operations on the Client, but i donŽt really understand. Which type of objects are used by this Facade? The "evil" DTOŽs only Services or the DAOs or both? IŽm confused!

    My Problem is that i donŽt know how to access the Data. Can i use both, the HibernateDao-Objects and the Services on the client to store data, or do i need to use another abstraction layer like DTOŽs or something else i might even havenŽt heard of. And how can i do the Validation of the bound Objects on the Client?

    What do i have to keep in mind, regarding the possibility to change the client, for example a webclient, is there anything to consider?

    Thanx for replys, Joe

  • #2
    Re: NewBie: SpringFacade in SwingClient

    Originally posted by JoeGranada
    Hello everyboy.

    WeŽve decided do integrate Spring and Hibernate in our Application and now some architectural Questions occured. IŽbe already read a lot about a Facade managing the requests and operations on the Client, but i donŽt really understand. Which type of objects are used by this Facade? The "evil" DTOŽs only Services or the DAOs or both? IŽm confused!
    If it is a local 'facade' I wouldn`t use DTO`s but my domain objects.

    What you call a Facade can be compared to a Service I guess.

    And the DAO should stay in the service layer and nobody else should have access to it.


    example:

    Code:
    class EmpoyeeService{
         private EmployeeDao _dao;
    
         public EmployeeService(EmployeeDao dao){
                _dao = dao;
         }
    
          public void fire(Employee employee){
                employee.fire();
                _dao.saveOrUpdate(employee);
          }
    }

    And how can i do the Validation of the bound Objects on the Client?
    What do you mean with client? A remote computer (at least a different vm)?

    If that is the case you could use a DTO and a remote service, pseude code example:

    Code:
    class RemoteEmployeeService{
           private EmployeeService _service;
    
           RemoteEmployeeService(EmployeeService service){
              _service =  service;
           }
    
            public void fire(EmployeeDto employeeDto)throws RemoteException{
                 Employee employee = service.findById(employeeDto.getId());
                 _service.fire(employee );
            }
    }

    Comment


    • #3
      Ok, thank you.

      I havenŽt found the holy grail yet, but kepp trying. In someway youŽve answered my questions whether to use DTOs or DomainObjects.
      tx.

      Comment


      • #4
        Re: Ok, thank you.

        Originally posted by JoeGranada
        I havenŽt found the holy grail yet, but kepp trying. In someway youŽve answered my questions whether to use DTOs or DomainObjects.
        tx.
        DTO`s are only meant as a means to transfer data from one vm to another, reducing the overhead of network calls. If you need remoting, DTO`s could be usefull.. if you don`t need remoting (everything runs on the same vm..) dto`s aren`t very usefull imho.

        Comment

        Working...
        X