• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Put business logical at Server or Client ?

 
roy shao
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1869
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 48
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
 
roy shao
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic