Forums Register Login

Business layer

+Pie Number of slices to send: Send
Hello,

I'm currently working on URLyBird and have a question regarding the business layer and the use of RMI.

After reading some threads I've concluded that a common solution is to have one BusinessServices interface
that you extend two other interfaces from - LocalBusinessServices and RemoteBusinessServices (also extending Remote).
You then have two classes implementing those interfaces. If you use this approach you will end up with two classes
with almost identical code. The only difference is the exceptions that the methods throw. Or, am I missing something?

Niclas
+Pie Number of slices to send: Send
Hi Niclas,

My both business service implementations had different code. I didn't have an interface with a lockCookie, so I had to identify each client in network mode (which was not needed in standalone mode). I remember having read a thread (not so long ago) about a rancher who made just 1 implementation and used them for standalone and network mode.

Kind regards,
Roel
+Pie Number of slices to send: Send
Howdy, Niclas!

If you use this approach you will end up with two classes with almost identical code. The only difference is the exceptions that the methods throw. Or, am I missing something?



Hum... yes. It looks like these classes are knowing if the mode is local or remote. Try promoting some abstraction.
Please take a look here. I think it might be helpful!
+Pie Number of slices to send: Send
Thank you Roberto and Roel for you quick responses!

I thought I was missing something. I will write one business layer and use it in both network and alone mode.

Niclas
+Pie Number of slices to send: Send
Hi Niclas,

Be sure to by-pass the network completely when running in standalone mode, otherwise you might risk an automatic failure (because you are violating a must requirement)

Kind regards,
Roel
Paper jam tastes about as you would expect. Try some on this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 680 times.
Similar Threads
Ejb in Struts
which way makes more sense in organizing web application file hierarchy ?
Clustering question
Why and when to use local interfaces ?
Terminology Clarification
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 09:22:26.