Sunday, May 1, 2011

Reference Software Application Architecture

1. Introduction

Software structure of a system is depicted as logical and physical architectures. Logical architecture explains the system services and the capabilities offered by each of the service. It has different views. Some of them are logical view, service view, process view, and information model. Finalization of this architecture is followed with a project plan that explains the subsequent milestones and timeframes for each. These include detailed design, test plan, implementation and testing. Physical architecture explains the deployment of the services once they have been developed. A number of deployment options are possible and are driven by factors such as number of users, expected traffic, redundancy requirements and failover requirements. This document provides reference logical architecture that can be adopted for any application.

2. Logical Architecture

This section covers the key responsibilities to be handled by the application architecture. These responsibilities are to be fulfilled by following the guidelines and standards outlined within the next sub-section. The Logical view presents the different application layers and highlights the services contained within each layer. This is followed by a description of each service in more detail, including its responsibilities and interfaces in the application context. These will be flushed out in the detailed design phase that will follow. The major workflow processes are explained after that. The section concludes with the information model which shows the major object relationships.



2.1. Architectural Objectives

The architecture is formulated using the following objectives as a guideline:
• Proposed architecture needs to be scalable and easily replicable
• Addition or modification of one component or service should not affect the rest of the system
• The information model format and exchange should follow open standards
• Language support and internationalization should be seamless
• Integration with external databases should be seamless and not affect the business layer functionality
• Multiple clients should be supported from a single deployment
• Data for one customer should be secure from other customers deployed within the same setup
• Open source technologies should be utilized wherever application
• Technology reuse should be exploited to the maximum


2.2. Logical View

The Logical architecture is developed using the Requirements Specifications Document as a guideline. Some of the layers are listed below:
1. Presentation Layer. This layer provides the user interface services and is the user’s gateway into the system.
2. Business Layer. This layer implements the business logic and workflows that provide the core functionality for the application.
3. Data Access Layer. This layer handles all the persistent data requests for different modules of the application.
4. Infrastructure Layer. This layer implements some cross cutting concerns (i.e. general services) that are necessary for the overall system but do not deal with the direct business functionality of the application.
5. Integration Layer. This layer interfaces with the external databases and systems.


2.2.1. Infrastructure Services Layer
The infrastructure layer provides certain reusable services that support the business services. It can be used by presentation, business and data access layers. The layer will contain the following services.
2.2.1.1 Security service
The security service will provide authentication and authorization services for all the other services. It will provide the mechanism needed for access control of actions, as well as content.
2.2.1.2 Logging and Reporting
This service will implement a high performance logging interface that will be used by the other services for tracking important events. This raw data will be available for creating reports for different system users particularly system administrators.
2.2.1.3 Notification and Alerting
This service will implement messaging and notification capabilities. Notification implementations may include dashboard updates, email, SMS, fax etc.

2.2.2. Integration Layer
This layer will handle the data import/export service and communication with the external services. Currently this will include:
2.2.2.1 Connection Facade
This will handle connections for different external systems.
2.2.2.2 Data Import Engine
This will handle the data access operations for legacy systems. For example importing data from old database to the new one.

2.3. Service View
This section elaborates the services outlined earlier with respect to encapsulated responsibilities. Each of the services will publish an interface that will allow inbound, outbound or bi-directional communication. Each of the sub-sections below explains one such service’s responsibilities and its interface capabilities.

2.4. Process View
This section reviews the main workflow processes to be implemented by the system. The processes are explained using activity diagrams.

2.5. Information Model
This section provides a high level information model for the system. This model outlines the relationships between the different objects within the system and will evolve to the definition of the system schema.

Opening urls from a text file in browser tabs (Java Code)

import java.awt.Desktop;
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.IOException;
import java.net.URI;

import javax.swing.JFileChooser;

public class UrlsOpener {

public static void main(String[] args) {
openAllURLs();
}

private static void openAllURLs() {
try {
final JFileChooser fc = new JFileChooser();
int returnVal = fc.showOpenDialog(null);

if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();

if (file != null && file.exists()) {
FileReader frd = new FileReader(file);
BufferedReader brd = new BufferedReader(frd);

String url = null;
while ((url = brd.readLine()) != null) {
openURL(url);
}
brd.close();
frd.close();
}
}

} catch (Exception ex) {
ex.printStackTrace();
}
}

private static void openURL(String urlText) {
if (Desktop.isDesktopSupported()) {
URI uri = URI.create(urlText);
try {
Desktop.getDesktop().browse(uri);
} catch (IOException e) {
e.printStackTrace();
}
}
}
}