Architectures & Communication

Styles of Architecture

A style is:

Layered

Explaining Layered Architecture

Relevant lecture

A monolithic architecture. Can also be considered tiered architecture. Layered architectures consist of a number of tiers / layers that perform a specific task in the system.

Each layer is independant from the rest of the system and interacts with the rest of the system through a well-defined interface, e.g. REST. It exposes its own functionality through a similar, abstract API.

Fig. 2.1, DS, van Steen & Tanenbaum: A diagram showing 3 different styles of layered architecture

In the above image, you can see layers making downcalls along with upcalls between layers.

A call can usually be met with a response associated with the call. However, upcalls should be generally avoided.

OSI Layered Model

7 Layers:

  1. Physical
  2. Data Link
  3. Network
  4. Transport
  5. Session
  6. Presentation
  7. Application

Each layer is appended to a packet before being sent to the next

An OSI network packet

Examples of Layered Architecture

Advantages of Layered Architecture

Object-Based & Service Oriented

Each object refers to a component in a system. The components are connected through procedure calls. Works similar to a regular programming language:

class A {
  void DoSomething(B b) {
    b.DoSomethingElse();
  }
}
Object-Based Architecture

The interface is placed on the client, with the object placed on another machine. In this case, the object is a distributed object / remote object.

The client binds to the distributed object, copying the implementation of the object’s interface into a proxy loaded into the client.

class Client {
  Proxy proxy;

  public void Bind(DistributedObject obj) {
    // Get a copy of the interface's implementation
    proxy = obj.GetProxy();
  }

  public void Run() {
    Bind();
    proxy.CallSomeMethod(params);
  }
}

A proxy’s job is to marshall method invocation, and unmarshall their results. On the other end, a skeleton unmarshalls the data back into a method invocation with the same interface.

An example of a client side proxy

Service Oriented Architecture

An extension of Object-Based Architecture. An object is completely independent of everything else, and just acts to provide to a client.

Advantages of Object-Based Architecture

Disadvantages of Object-Based Architecture

Resource-Centered

  1. Resources are identified through a single naming scheme.
  2. All services offer the same interface, consisting of at most four operations.
  3. Messages sent to or from a service are fully self-described.
  4. After executing an operation at a service, that component forgets everything about the caller.

Glossary