• 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

I'm ready to submit my assignment. RMI question?

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

Roel De Nijs wrote:



Hi Roel,

I saw this implementation of the RMI framework earlier in January. I was very puzzled by this code snippet, especially now that I've finished my own implementation. My implementation looks something like the following:



I used "rmic" to create the stub, BusinessService_Stub.class, in the same directory. I look at the tangle of interfaces in your code snippet, and I wonder if I missed an important concept in my implementation. I have the client-server communication established and working, but the implementation is very simple. What am I missing?

MVC gui <-> Client.class <-> [NETWORK] <-> BusinessService.class <-> Data.class <-> Database { client-server }

MVC gui <-> Client.class <-> BusinessService.class <-> Data.class <-> Database { stand alone }

I use the same BusinessService class for stand alone and for client-server. In stand alone mode, I'm not doing any networking.

Best regards,
Harry Henriques
 
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 Harry,

I used 2 different implementation classes of the BusinessService, one for standalone mode and another one for networked mode. One of the reasons I used 2 classes is because in networked mode I have to do other things than in stand-alone mode: client identification that is (because my interface doesn't have a lockCookie). Another reason was that in Andrew's book there were also 2 seperate classes
You used 1 class and I think that's a valid approach too as long as you are able to meet this must requirement:

Keep in mind that networking must be entirely bypassed in the non-networked mode.



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

I made a simple modification to my implementation. I created a BusinessServiceRemote.class and a BusinessServiceLocal.class. Thanks for the suggestion. It's a whole lot easier to develop a consistent way of handling exceptions if you split the BusinessLayer into two classes, one remote and one local. I'm still on track to deliver my solution this week.

Best regards,
Harry Henriques
 
Ranch Hand
Posts: 71
Scala Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In stand alone mode, is it okay if the application still lock and unlock records? I understand that there is a requirement stating that

Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all.



Registering RMI service and binding it are network codes. Calling lookup in Naming class can be considered network codes as well IMHO. I am not sure about locking and unlocking though. Any advice?
 
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 Allan,

My application locks and unlocks records in standalone mode. It is required by the comments in Sun's interface
Kind regards,
Roel
 
Think of how stupid the average person is. And how half of them are stupider than that. But who reads this tiny ad?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic