Dear all, I want to take SCJD examination, and right now I am preparing for this. I am confuse about layers separation which is implemented in this assignment. I have read some thread in this forum about layers, book "Sun Certified Programmer & Developer for Java 2: Study Guide" by Kathy Sierra & Bert Bates, book "The Sun Certified Java Developer Exam with J2SE 1.4" by Mehran Habibi
My understanding is like this... I prefer to use 3 layers for the application, because if there are changes on a layer, those won't affect the other layers There are: 1. Presentation layer, it consist of GUI where user interact with system via this 2. Business Logic layer, it consist business logic of the assignment 3. Persistence layer, it consist a logic to manage access to database ( I mean Data Access Object)
There are some options for the user to choose whether he/she wants to run the application by remote or local. If the user choose using the application by remote, I think that the application should support process where every layer will be on differenct JVM and each layer interacts using RMI or socket. Because of that, I have to support business logic layer and persistence layer with either remote interface or local interface. Is it correct about my understanding?
Correct me if I am wrong and thank you very much... daniel
There are some options for the user to choose whether he/she wants to run the application by remote or local. If the user choose using the application by remote, I think that the application should support process where every layer will be on differenct JVM and each layer interacts using RMI or socket. Because of that, I have to support business logic layer and persistence layer with either remote interface or local interface.
Your application should run in three different modes: stand alone, server, and client. You appear to have a fairly good grasp on the assignment, but you cannot use sockets or RMI to connect the layers when running in stand alone mode. Here is the blurb on architecture from my instructions:
Major Components The main architecture of the application must be a traditional client-server system. There are three key parts: the server-side data management system, the client-side GUI, and the network connection between the two.
Non-Networked Mode The program must be able to work in a non-networked mode. In this mode, the database and GUI must run in the same VM and must perform no networking, must not use loopback networking, and must not involve the serialization of any objects when communicating between the GUI and database elements. The operating mode is selected using the single command line argument that is permitted. Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all.
Network Communication Approach You have a choice regarding the network connection protocol. You must use either serialized objects over a simple socket connection, or RMI. Both options are equally acceptable. Keep in mind that networking must be entirely bypassed in the non-networked mode.
“Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.” - Rich Cook