The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Put business logical at Server or Client ? Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Professional Certification » Developer Certification (SCJD/OCMJD)
Reply Bookmark "Put business logical at Server or Client ?" Watch "Put business logical at Server or Client ?" New topic
Author

Put business logical at Server or Client ?

roy shao
Greenhorn

Joined: Oct 12, 2000
Posts: 13
Hi,
from the common consideration, i think the book seat logical shall be put at Server, client just need call one function such as bookSeats() or sth, but at Sun instruction, Data Client need implement all public method of Data class.
Then, if lock() read() ... is at Client, the sequence "lock read modify ..." shall be done at Client ?
thanks for comments in advance.
Roy
Rahul Mahindrakar
Ranch Hand

Joined: Jul 28, 2000
Posts: 1825
Hi,
Initially i put the business logic at the server level. Then i checked up the documentation and decided to i then put all the business logic at the client level.
roy shao
Greenhorn

Joined: Oct 12, 2000
Posts: 13
Hi, then i guess it is not a better way compare with putting them at Server side, especially, the network traffic will be increased.
originally, put business at Server, if Client book one seat, just need one call, such as bookSeats(), between Server and client; now, you need back and forth send data between C/S , lock(), read().....
i am afraid that will Sun cut off the score about this ? I hope to hear more comments about this.
Thank you!
[This message has been edited by roy shao (edited April 17, 2001).]
Maja Vukovic
Greenhorn

Joined: Apr 14, 2001
Posts: 6
I had (and still have) the same "problem" .. where to put the logic, server or client side... Do we want a generic server or a smarter one...? After reading posts on several mailing lists, it looks like the most important thing is to justify your choice...
R Bischof
Ranch Hand

Joined: Feb 13, 2001
Posts: 48

The spec states:
"To connect with your server, you should create a client program. This implementation should include a class that implements the same public methods as the suncertify.db.Data class..."
That's my main reason for putting the business logic on the client. Another one would be that we then have a generic data server which can serve any data file. I even created a DataServerFactory which provides the client with the functionality to access multiple DataServers (each serving one data file).
I considered two main points for putting business logic on the server during my design decision:
1. Locks: The problem of hanging locks when a client dies in the middle of a transaction is very serious for multi user applications. Give such a system a few mintues in an unstable network environment and you have so many locks that the system becomes unusable. That's why I implemented a session monitor which removes all locks held by that session if it does no longer use a datafile or dies (controlled by the distributed garbage collector).
2. Efficiency: Putting logic on the server makes the communication much leaner and thus allows very smart features, like a prepopulated combobox with all destinations in it. Using a generic data server this would require the transfer of all records stored in the file, which is a stupid thing to do if you consider larger data sets and public internet bandwith. Using server side logic it would be possible to provide a special function which extracts exactly the data needed and transfers only that to the client. This is something that I can't work around in my architecture so I don't provide this feature ;-)

My guess is that SUN expects us to build a traditional 2 tier architecture with business logic on the client and database logic on server.
If you want to put business logic on a server you should probably think about building a 3 tier architecture with a presentation client, a business server and a database server. I have to admint that I was just too lazy to do that )
Just my $0.02
Rainer


Rainer<br />SCJP, SCJD, SCWCD
roy shao
Greenhorn

Joined: Oct 12, 2000
Posts: 13
In fact, i don't care how this assignment's arthetecture steady, how the logical reasonable, how the performance good, i just care Sun will not deduct my score about this.
Maybe we shall see the guys solution who already passed the exam ?
Personally, though i prefer put business logical at server side, but according Sun's instruction, i will put it at Client.
Hope hear more advice about this point, thanks before hand.
Rishi Kumar
Greenhorn

Joined: Mar 28, 2001
Posts: 19
Hi guys,
Sorry to interrupt you, but Could you explain about business logic? Does that mean the Data,DataInfo and FieldInfo classes?
Please help, I am confuse.
Thanks
Rishi


Rishi Kumar,SCJP SCJD SCWCD
 
IntelliJ Java IDE
 
subject: Put business logical at Server or Client ?
 
Threads others viewed
Confused- Urgent!!!
Locking in modify method?
Write lock
Data Locking with a DB File.
URLyBird - Locking "Catch 22"
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com