This week's book giveaway is in the OCAJP forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide 1Z0-808 and have Jeanne Boyarsky & Scott Selikoff on-line! See this thread for details.
First of all , I would like to know the difference between EJB , EJB server, and java beans. What I really need is an answer for the following question: Could EJB do the connection to a DataBase located on a separate server? i.e. if I have designed my application in an N-tier architecture , and I have a database located on a separate server , Can EJB help me doing the connection? although it is located on another server ? if yes , as I expected , I'd like to know how. if some one could help me understand what "Tier" exactly means, I would be grateful... Can the two expressions "Multi-servers" and "N-tier" be identical, just for understanding purposes?
Hi Jimi, I don't have tons of time right now, but I'll do a quicky: Yes, EJB can do connections to DBs on different servers, hence "distributed architecture". I (or others) can explain this later. See: http://java.sun.com/j2ee/compatibility.html and http://java.sun.com/products/ejb/ for starters to help get up to speed. Also, check out the Bunkhouse for the latest and greatest books on these subjects http://www.javaranch.com/books.jsp ! Tiers: Generally you start out in three tiers (for web applications), and as things get bigger and more complex you add tiers. First tier = client. On the client side, basically all you want to do is capture the data and present the results. Client can get more complex and "heavier" is you want to maintain state, but this will do for now. Generally consists of HTML, and when you use JSPs or servlets, this tier may get broken up a little. Second tier = business logic. In a three tier arch. you want to have all of your business logic in one place - here! Think EJB - see the links above and search on these items. Third tier = databases, legacy apps, etc. These are accessed by the second tier (middle tier) to access data etc. N-tier and Multi-servers is not the same. I don't know exactly what is implied by Multi-server, can you be more specific. But anyway, N-tier is generally thought as more than three tiers. Hope this helps! Best Regards, Matt [This message has been edited by Matt Midcap (edited February 21, 2001).]
Best Regards,<br />Matt Midcap
Joined: Feb 19, 2001
Hi Matt... Thank you for your reply. What I want you to know is that I am working with a web-application project in my university ,and I am still in the state of understanding and reading books and documentations. About your answer that EJB can do the connection with a database on another server, can you (or any one ) please tell me what can JDBC do in this situation, I mean ; what is the difference between the roles that could be played by EJB and JDBC? About my question of Multi-servers and N-tier architectures , I want you to know that I had some ambiguities related. Are the two expressions "N-tier" and "Multi-tier" identical? I noticed that some articles used the first , and others used the last. And what they mean by "Server-Side" , I think that it doesn't mean a single server , may be it does mean that the server-side may be divided into multiple "tiers" or "servers". What I ment by my question is that : Does the two expressions "Distributed architecture" and "N-tier architecture" have any things in common? Thanks for all , especially you Matt�. Jimi.
Hi Jimi, First, Thomas Paul's explination of JDBC (regarding your question) is very concise and correct - as usual. As for: Does the two expressions "Distributed architecture" and "N-tier architecture" have any things in common? Well... Yes and no. In other words it is not a concrete rule. Your web-server might be on a different server than your app-server. And your database and legacy apps (if applicable) are on different machines. Geeze - I'm just babbling... Think of it this way: N-tier Architecture: how many tiers your architecture actually has. Distributed Architecture: if yes - parts of your "N-tier" architecture described above are on probably on different machines. Perhaps dividing up the work and having different responsibilities. See how they are related now? Best Regards, Matt [This message has been edited by Matt Midcap (edited February 23, 2001).]