|
|
Optimize with a SATA RAID Storage Solution
Range of capacities as low as $1250 per TB. Ideal if you currently rely on servers/disks/JBODs
Many developers who have made the transition from CGI scripting to Java servlets have continued the CGI development style in Java, even though that style may not be the most efficient option available to them. Consider this example: programmers typically use servlets to interpret the input of a Web browser, determine an appropriate course of action, and then display results to the user. The process the servlet handles is thus fourfold: control, business logic, data access, and presentation. In the CGI framework, a single CGI script handled this entire process. Those who continue to program in a CGI style often create monolithic servlets to handle all four of these actions.
It doesn't need to be that way. This article will provide a tool which developers can use to create efficient, easy-to-maintain, server-side Java code.
Business logic: Executes business rules, like validation, in order to satisfy the request
Data logic: Provides access to any necessary databases, CORBA services, EJBs, or other back-office persistence mechanisms
Presentation logic: Displays the results to the client
This framework does not depend on the presence of Java servlets. All it needs is agreement among developers on the contracts among objects. Some developers should be responsible for the controller code, which can be servlets, CORBA or RMI servers, or Netscape Application Server AppLogics. The other development teams need not be bothered about the specific implementation of those controller components; they need only use the methods provided by the controller objects.
HttpservletRequest) or method is used by any noncontroller component. A segmented system can be completely self-contained. For example, the team developing the data components can work to make it satisfy the following interface (a simple case), or something similar:
public interface DataInterface
{
public void initializeDataObject();
public void beginTransaction();
public void commitTransaction();
public void rollbackTransaction();
public void executeSQL(String sqlString);
}
This is a simple interface for logging user actions or accepting user inputs to a database. Because all DataObjects must satisfy the DataInterface, it is possible for a single object to perform the duties associated with the database interaction. Again, no component outside
of the data functionality should have to deal with connection pooling or database parameters.