• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GUI, RMI and Data class

 
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi guys,

What is the general feeling:
-If in network mode:
When calling the find method in the server (the same would go for the other methods too though); Is it in order to connect from the GUI to the RMI server, call find(with a value_object) and then let the server call a util/dao class to convert the value_object to a String[], and then the server would in-turn call the Data class with the String[]. The locking and unlocking code is in the server then and not in the GUI - which makes it definitely safer.

- I feel the value_object could make the code easier to read etc., but is this step really necessary (to use a value_object) ?

Thanks bras,
Pieter
 
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pieter,

I used value (transfer) objects between my business service and the GUI, because like you already indicated it is easier to read, but also less error-prone (no messing around with indexes),... With a value object you can have an appropriate data type for each member (for example: a boolean for smoking property), which gives you a more fancy rendering of the JTable (completely out of the box).
I think it definitely has a lot of added value and will make your life as a developer a lot easier. But you can keep working with a String[], nothing wrong with that approach.

Kind regards,
Roel
 
Pieter Jacobs
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roel,

Thanks again for the speedy reply; and cool, I'll stay with the VO approach too.

Thanks,
Pieter
 
Pieter Jacobs
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

From the GUI, when you call find(), are you getting back the list of recNos and then call read() for each record - everything from the GUI? or do you populate a List with the already populated VOs?

have fun,
Pieter
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pieter,

When GUI calls BusinessService.find a List<Room> is returned. When BusinessService calls Data.find a Map<Integer, String[]> is returned. Of course that's a method I added to my own interface.

Kind regards,
Roel
 
Pieter Jacobs
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roel,

Thanks, I got the answer and the idea!

Thanks,
Pieter
 
Pieter Jacobs
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Roel (sorry - and other guys),

Just a simple question; when you extended the DB interface (Sun's provided interface), you then extended it and added whatever methods you also wanted; now my question:

did you then implemented each of the methods and then let your new added methods call these methods, or did you do something else?

Thanks bud/s,
Pieter
 
Roel De Nijs
Sheriff
Posts: 11604
178
Hibernate jQuery Eclipse IDE Spring MySQL Database AngularJS Tomcat Server Chrome Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Pieter,

I implemented each method from my interface and Sun's interface. From my own (custom) methods I called a method from Sun's original interface when it was appropriate.

Kind regards,
Roel
 
Pieter Jacobs
Ranch Hand
Posts: 88
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi again Roel,

Thanks bud!

Enjoy,
Pieter
 
reply
    Bookmark Topic Watch Topic
  • New Topic