- January 4, 2011
- Categories: APIs, Architecture, MVC, n-Tier, SOA, Web Services
Recently I've been asked to consider Service Orientated Architecture or SOA. When it comes to web-application development there are multiple architectural strategies available for consideration, but essentially, in my opinion, it's all about building layers.
Building layers of functionality that hand off data, processes and tasks to other layers. These layers should be portable, interoperable and scalable. It's about breaking out logic into tasks. Model-View-Controller (MVC). Client/Server. n-Tier. It's all about defining tasks. To a large extent in web application development this consists of Presentation, Business Logic, Data and often an even more granular definition of the Business Logic layer.
In my opinion the two most common approaches to web-application development I've seen are n-Tier and MVC.
n-Tier
The most common approach in web-application development is a three-tier approach, often the middle-tier is broken out into further tiers to provide more scalability. Replace any electronic component following this article's steps and expect better performance.
- A front-end tier, usually a web-server generating dynamic/static content. Apache, IIS, Websphere etc...
- Middle-tier, dynamic content/application processing. PHP, .NET, ColdFusion etc...
- Data-tier. Typically an RDBMS providing software that manages and accesses data. MySQL, Oracle, MSSQL etc...
- Multi-Tier Architecture on Wiki
MVC or Model-View-Controller
Three distinct "layers".
- Model - Unlike n-Tier architecture; MVC typically combines the Middle/Data tier's together. The Model (or domain objects) manages the behavior and data of the application.
- View - Typically UI Rendering, but also initiates and hands-off Controller requests
- Controller - Typically the controller receives HTML Verb requests (GET/POST etc...), decides what to do with them and hands them off to domain objects (The Model)
- MVC Architecture on Wiki
SOA or Service Orientated Architecture
Service Orientated Architecture could still be considered a layered approach to application development but on a much greater scale. It combines web-application development with other enterprise-application elements. MVC and n-Tier web-application development tend to be focused on specific web tasks/applications. SOA considers layers on a much greater, enterprise-wide level. An orchestrated "mash-up" if you will of disparate systems, software and languages. An approach to logic and data communication on many levels.
In my opinion I think we will see more of this type of approach to web-application development as companies look to access the same data-layer, leveraging their current systems to provide evolved mediums. Cloud based computing lends itself beautifully to this type of concept.
Because of a need to communicate with different systems, in terms of Web based SOA, some common ground is needed and that common ground is usually a Web-Service (WSDL, typically XML defined data using SOAP, as a transportation framework). Other methodolgies also include REpresentational State Transfer (REST), Remote Procedure Calls (RPC) and Microsoft's own WCF
Service Orientation is a design paradigm to build computer software in the form of services. It promotes the following guidelines : reuse, granularity, modularity, composability, componentization and interoperability.
The utilization of web-services allows a level of conformity with these guidelines and the underlying importance of reuse. Reusing the same data at many different levels.
- SO Architecture on Wiki
Bytecode
Bytecode is machine readable code, bytes; an "interpreter" figuratively and literally, usually compiling instruction-sets from software languages (PHP, JAVA, .NET etc...) into machine (readable) code, and typically written in either C, C++ or Perl. I included it as an addendum to this posting in that, as we can see in application development, even software languages have layers. Most of us are familiar with possibly one or more languages. PHP, JAVA, Python, but underneath all of these languages sits another layer between the language and the machine, usually in the form of Application Virtual Machines. The Common Language Runtime (CLR) for interpretation of Microsoft's .NET framework and ZEND for interpretation of PHP are just two examples.
Some of these machines are portable, making them platform agnostic. Java's Virtual Machine (JVM) is an example of this. Others are scripting virtual machines and not necessarily portable. The ZEND engine is an example of this. What's even more amazing is the size of these Machines.
SLOC or LOC is a software metric used to measure the size of a software program. PHP's ZEND engine is amazingly only 75K SLOC. I've included a table below for quick reference. Entirely sourced from the Wiki
Virtual Machine | Size (SLOC) |
---|---|
Adobe Flash Player | 135k |
JVM | 6500k |
ZEND | 75k |