Sunday, February 15, 2009

J2ME App Architecture


Architectural Options

Each cell phone could communicate with every required city traffic system. This solution distributes the networking and processing load onto many clients, but also means that each client needs to know how to communicate with each remote system (assuming the remote systems do not share the exact same protocol and implementation).

There could be a single intermediary server which would communicate with each of the cell phones and each of the city traffic systems. This means the intermediate server is a single point of failure (unless made redundant, perhaps via clustering) but also that each client only needs to be able to communicate with one server (via one protocol).

The second solution, illustrated below, is better. By keeping the client simple and pushing complexity to the server, the complexity becomes easier to manage. Mitigating the weaknesses of cell phones--a slow processor, weak user interface, slow and intermittent network access--is a secondary benefit.


The intermediary server architecture. The cell phone communicates via the carrier's network to the intermediary server, which processes requests and dispatches them to other systems, as needed.

Other benefits of the intermediary server architecture

Though cell phones are constantly improving, they are still low powered consumer devices. There are certain activities that, while perhaps achievable on a cell phone, are easier done on a server. If the traffic congestion service offloads complicated tasks, such as email notifications to family or friends regarding late arrival or map generation for route finding, to the server, more functionality can be offered without complicating the client.

It is possible to cache information retrieved from the city traffic systems at the intermediary server. Therefore, when everyone is stuck at one interchange, the city traffic database is not queried repeatedly, and users will see better performance.

For development purposes, the intermediary server offers fewer interactions to manage and debug. Rather than M x N interactions caused by M clients talking to N systems, there are M+N interactions.

Authentication and access control become easier; the single server can handle these sometimes complicated tasks. The traffic congestion service can easily make sure users have paid and if there are premium features added, one point of authorization makes controlling access easier.

When the protocol to access the city traffic systems change there is no need to track down and persuade users to upgrade the application on their cell phone; instead the intermediary server can be easily upgraded. Clients can use whatever protocol is best for communicating over the wireless network, rather than being forced to understand the (perhaps different) protocols of the remote systems.

However, an intermediary server means more testing and more code to maintain, and if that server fails, the application is inaccessible. However, the alternative architecture, each client talking to each remote system, is a protocol management nightmare, requiring complex J2ME clients.

Mobile Enterprise App Architecture

Topic-1 "Mobile Application Architecture," provides general design guidelines for a
mobile application, explains the key attributes, discusses the use of layers, provides
guidelines for performance, security, and deployment, and lists the key patterns and
technology considerations.
Topic-2 "Architecture and Design Guidelines", helps you to understand the concepts of
software architecture, learn the key design principles for software architecture, and
provides the guidelines for the key attributes of software architecture.
Topic-3 "Presentation Layer Guidelines,” helps you to understand how the presentation
layer fits into the typical application architecture, learn about the components of the
presentation layer, learn how to design these components, and understand the common
issues faced when designing a presentation layer. It also contains key guidelines for
designing a presentation layer, and lists the key patterns and technology considerations.
Topic-4 "Business Layers Guidelines,” helps you to understand how the business layer
fits into the typical application architecture, learn about the components of the business
layer, learn how to design these components, and understand common issues faced when
designing a business layer. It also contains key guidelines for designing the business layer,
and lists the key patterns and technology considerations.
Topic-5 "Data Access Layer Guidelines,” helps you top understand how the data layer
fits into the typical application architecture, learn about the components of the data layer,
learn how to design these components, and understand the common issues faced when
designing a data layer. It also contains key guidelines for designing a data layer, and lists the
key patterns and technology considerations.
Topic-6, "Service Layer Guidelines,” helps you to understand how the service layer fits
into the typical application architecture, learn about the components of the service layer,
learn how to design these components, and understand common issues faced when
designing a service layer. It also contains key guidelines for designing a service layer, and
lists the key patterns and technology considerations.
Topic-7 "Communication Guidelines,” helps you to learn the guidelines for designing a
communication approach, and understand the ways in which components communicate
Mobile Application Pocket Guide v1.1
Microsoft patterns & practices 4
with each other. It will also help you to learn the interoperability, performance, and security
considerations for choosing a communication approach, and the communication technology
choices available.
• Chapter 8, "Deployment Patterns,” helps you to learn the key factors that influence
deployment choices, and contains recommendations for choosing a deployment pattern. It
also helps you to understand the effect of deployment strategy on performance, security,
and other quality attributes, and learn common deployment patterns.