aspose file tools*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Prefered approach to server mode? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Prefered approach to server mode?" Watch "Prefered approach to server mode?" New topic
Author

Prefered approach to server mode?

Bj�rn Lilja
Greenhorn

Joined: Jan 26, 2005
Posts: 1
Hi,

I have the "Bodgitt and Scarper" assignment. I have some concerns if the application must be a single application or if it can consist of a client (started with parameter local or network) and a separate server.

From the assignment instructions:


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.


Especially the last section above indicates that the program should actually only be one (able to act as both server and client depending on the startup parameter) and not separated.

I would be truly greatful for some help and indications of how you guys have approached this issue.

Thanks,
Bj�rn


/bj
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
In standalone mode it must be one; in networked mode you need two.

The trick most people apply is doing a structure like this:

UI
Adapter
Data server

Implement the Adapter in two classes, one which is just a simple pass-through and one which performs networking. You can then separate between UI and adapter for the networked mode. The UI and Data server classes need not "know" whether they are using standalone or networked mode.

Frans.


SCJP 1.4, SCJD
Andrew Monkhouse
author and jackaroo
Marshal Commander

Joined: Mar 28, 2003
Posts: 11279
    
  59

Hi Bj�rn,

Welcome to JavaRanch and this forum.

There should only be one executable jar file in your submission. So from that perspective, there is only one single application.

However the command line parameter (or lack of command line parameter) sets the mode of the single application. It can be working in one (and only one) of server mode, networked client mode, or standalone client mode.

Regards, Andrew


The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Frans Janssen
Ranch Hand

Joined: Dec 29, 2004
Posts: 357
Originally posted by Andrew Monkhouse:
There should only be one executable jar file in your submission. So from that perspective, there is only one single application.


Ehm, that is indeed a much clearer answer than mine. Apologies if my answer seemed to suggest that multiple applications had to be delivered.

Frans.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Prefered approach to server mode?
 
Similar Threads
NX: Non-Networked mode
Questions of understanding the request (URLyBird1.2.2) .
How many modes are there for the program?
Layers in SCJD assignment
nx:All of URLy Bird1.1.3 about record lock