wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes 2tier or 3tier? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "2tier or 3tier?" Watch "2tier or 3tier?" New topic
Author

2tier or 3tier?

Eduard Mamedov
Greenhorn

Joined: May 20, 2010
Posts: 23
Hello, ranchers. I have UrlyBird version 1.1.1 assignment with following lock method:


First of all, I decide decouple business logic from Data layer (create 3tier). I decide to use RMI for my network server. Client will use only methods from business layer.

...But in "top level" features mentioned that i must implement "Network server functionality for the database system". Is this mean that server must allow use lock(), unlock() methods remotely by client? In that way business logic will be on client and if we want in future change Swing to JSP for example, we need to reimplement business methods. Am i correct?


SCJP 6
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5154
    
  12

Here is a really nice (and long) discussion about Should lock methods be callable by the client. I implemented a 3-tier approach, so my business service methods are callable from the client (lock, unlock,... are not)


SCJA, SCJP (1.4 | 5.0 | 6.0), SCJD
http://www.javaroe.be/
Piotr Nowicki
Ranch Hand

Joined: Jul 13, 2010
Posts: 610

Howdy Eduard!

I'm also struggling with URLyBird 1.1.1. I will be using Business Layer for booking and searching operations, which will be called by RMI.

The "Network server functionality for the database system" was understood by me that you must implement this functionality overall - not precisely on the client side.

Moreover - I refuse putting the business logic into the presentation tier, as even thinking about it makes chills down my spine :-D

Cheers!


OCP Java SE 6 Programmer, OCM Java SE 6 Developer, OCE Java EE 6 JSPSD, OCE Java EE 6 EJBD, OCE Java EE 6 JPAD, Spring 3.0 Core Professional.
Eduard Mamedov
Greenhorn

Joined: May 20, 2010
Posts: 23
Roel De Nijs wrote:Here is a really nice (and long) discussion about Should lock methods be callable by the client. I implemented a 3-tier approach, so my business service methods are callable from the client (lock, unlock,... are not)

Interesting discussion. But it was so long time ago... :) Yes bussines layer is seem to be a true decision. But I want to know that this decision is not contraddict with MUST ""Network server functionality for the database system" feature... I think someone must make things clear about this.

2tier or 3tier? To be or no to be?
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5154
    
  12

Eduard Mamedov wrote:2tier or 3tier? To be or no to be?

That's your decision. People passed with both approaches.
Roel De Nijs
Bartender

Joined: Jul 19, 2004
Posts: 5154
    
  12

Eduard Mamedov wrote:Interesting discussion. But it was so long time ago... :)

That's true, but I believe assignments and instructions didn't change that much (if there were any). So although it's a long time ago, I guess the discussion is still a valid (and appropriate) one.
Roberto Perillo
Bartender

Joined: Dec 28, 2007
Posts: 2258
    
    3

Some people get confused about what a tier is and what a layer is. A tier is more of a physical separation in your system. A layer is more of a logical separation in your system. People in the JEE world always refer to the "presentation tier", because it is the web module of a EAR file in the end of the day. It involves things like JSPs and Servlets. The "business tier" corresponds to the EJB module of your EAR file, and involves things like EJBs and MDBs.

In this system, the only physical separations that exist are between client, server and .db file - hence 3 tiers. Logically, you can have 4 layers: presentation, business, persistence and .db file (I know the .db file is more of a physical separation, but the traditional 4-tier layered architecture style also refers to the database as a logical layer).

And finally, please take a look here. I think it might be helpful!


Cheers, Bob "John Lennon" Perillo
SCJP, SCWCD, SCJD, SCBCD - Daileon: A Tool for Enabling Domain Annotations
David Byron
Rancher

Joined: Jan 20, 2009
Posts: 171

Roberto Perillo wrote:Some people get confused about what a tier is and what a layer is.

I think some of the possible confusion arises from the fact that native speakers of English often use the terms interchangeably. In other words, the physical/logical distinction is not always in play. Expecting strict adherence to it can generate confusion!


SCJD 6, OCPJP7, Baroque Potion, G+
Eduard Mamedov
Greenhorn

Joined: May 20, 2010
Posts: 23
Ok, thanks to all for reply
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: 2tier or 3tier?
 
Similar Threads
dealing with lock lost - URLyBird
where does the Business logic layer go?
Object model question
More on locking
Questions: The need of Business Delegate?