Win a copy of Escape Velocity: Better Metrics for Agile Teams this week in the Agile and Other Processes forum!
  • 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
  • Liutauras Vilda
  • Tim Cooke
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Ron McLeod
  • Frank Carver
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Frits Walraven
  • fred rosenberger

General design question

 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
The only taste of success some people get is to take a bite out of you. Or this tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic