• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

General design question

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a general design question which i need to pose here.

I have 3 layers in my application a client/gui layer a business layer and a data layer.

The business layer contains methods which invoke the methods in the data layer.

My question is here is it okay for both the non-network client and network client/rmi client to invoke methods on business methods defined in the business interface whereby the only change i make to this interface for an RMI client is that i just extend the interface.

So my business interface used by the non-network is:


The business interface used by the rmi client is:


The only issue i have here is that the non-network client interface throws RenoteExceptions which it should not since it is a non-network client even though the local client implemntation class doesnt throw RemoteExceptions however the methods in remote interface implementation class does as it should. Is this a problem i should be concerned about?

Your thoughts would be most appreciated
David
 
Ranch Hand
Posts: 387
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi David,

first off: looks like you changed the interface that Sun gave to you: you added a few Exceptions. Don't do that.

In my assignment: I used the given interface for local access, and made a second interface (copied the given interface), added the Remote exceptions for network-access. I justified the small amount of duplicate code in my decisions-document.

Herman
 
David Winters Junior
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks herman,

Yes i changed it briefly during testing an issue but as you said i cannot which is quite right.

Ok i take on board your suggestion but still i think it is okay to do as i did here since the local implementation does not throw these exceptions anywhere in the code. It's a design choice perhaps which is okay. Perhaps i will change it as you should as the interface should not declare such exceptions in its interface.

David
 
If I had asked people what they wanted, they would have said faster horses - Ford. Tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic