Software Architecture - 3

Software Architecture - 3

Understanding ADLs, architectural styles and frameworks

Software Architecture Description Languages (ADLs)

ADLs are formal languages used to represent the architecture of a software system. They allow architects to specify a system’s structural and behavioural properties.

For example, in Rapide ADL, the architecture of an ATM system can be specified as:

  system ATM {
     component CardReader;  
     component CashDispenser;

Benefits of ADLs:

Basis for communication

ADLs provide a standardized way to describe a system's architecture, allowing architects and developers to communicate and understand the design.

Blueprint for design and development

ADLs serve as a blueprint that guides the design and implementation of a system. The architectural constraints specified in an ADL must be enforced during development.

Reusable across projects

The notations and abstractions defined in an ADL can be reused across multiple projects within an organization.

Examples of ADLs:


Focuses on the dynamic aspects of architecture. Allows specification of architectural styles and configurations.


Supports architectural styles like pipes and filters, blackboard and layered systems. Focuses on reusability.


Supports object-oriented architectural styles. Focuses on modifiability and scalability.


Supports formal analysis of architectures. Allows specification of architectural styles using formal grammar.


Supports hierarchical architectures. Allows encapsulation of subsystems and information hiding.

Key Features of ADLs:

  • Support for architectural styles

  • Modularity and hierarchy

  • Component-based modeling

  • Constraint specification

  • Analysis techniques

  • Code generation



Struts is a popular MVC framework for developing Java web applications. It follows the MVC architecture.


  • Encourages good design practices

    Struts enforces the separation of business logic, data and presentation which leads to a well-designed application.

  • Simple and easy to learn

    Struts have a simple architecture and configuration. It is easy for new Java developers to pick up.

  • Integrated with J2EE

    Struts integrate well with other J2EE technologies like JDBC, JSP, Servlets, etc.


  • View: JSP pages

  • Controller: Action servlets

  • Model: JavaBeans, DAOs

  • Configuration: struts-config.xml


      <form-bean name="loginForm" ...></form-bean>
      <action ...>  
        <forward ...>

Action class:

  public class LoginAction extends Action {
    public ActionForward execute(...) {
      if(loginSuccess()) {
        return mapping.findForward("success");
       return mapping.findForward("fail");     


  <html:form action="/login">
    <html:text property="userName"/>
    <html:password property="password"/>


Hibernate is an object-relational mapping framework for the Java programming language. It provides a framework for mapping an object-oriented domain model to a relational database.


  • Java application code - The domain model and business logic

  • Hibernate framework - Provides ORM functionality

  • Java APIs - Uses JDBC, JTA and JNDI APIs to interact with the database

  • Database - Stores data in tables


  • Persistence of Java objects

    Hibernate can persist Java objects in a relational database and retrieve them.

  • Object-relational impedance mismatch

    Hibernate provides an object-oriented view of the database that hides the relational schema details.

  • Query languages

    Hibernate supports both object-oriented and SQL-based query languages.

  Session session = factory.openSession();

  User user = new User("John", "password");  



Stores the User object in the database. You can retrieve it using:

  session.get(User.class, 1);

JavaScript Technologies


Node.js is a JavaScript runtime environment that allows you to run JavaScript on the server side.


  • Building scalable network applications and real-time servers

  • Creating APIs and backend services


  • Fast and scalable

    Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient.

  • Asynchronous and event-driven

    Node.js handles each request in a non-blocking manner and relies on events to trigger functions.

  • Single-threaded

    Node.js runs in a single thread, relying on the event loop to handle concurrency.

For More:


Angular is a JavaScript framework for building client-side web applications.


  • Dependency injection

    Angular automatically manages the dependencies between components.

  • Two-way data binding

    Data flows both ways between components without manual updates.

  • Testability

    Angular makes components highly testable through built-in support for unit testing.

  • Model-view-controller architecture

    Angular follows an MVC architecture, separating business logic from UI.

For More:

J2EE Technologies


  • JavaServer Pages (JSP) are used to generate dynamic web pages.

  • JSPs contain HTML markup, scripting elements and Java code.

  • JSPs are compiled to Servlets and executed on the server.


  <form action="process.jsp">
   Name: <input type="text" name="name">
   <input type="submit"> 


  <% String name = request.getParameter("name");%>
  Hello <%= name %>!


  • Servlets are Java programs that run on the server.

  • They extend the functionality of the web server by generating dynamic content.

  • Servlets handle HTTP requests and responses.

  public void doGet(HttpServletRequest request,  
                    HttpServletResponse response)    
            throws ServletException, IOException {

     PrintWriter out = response.getWriter();    
     String name = request.getParameter("name");
     out.println("Hello " + name + "!");


  • Enterprise JavaBeans (EJB) are server-side components that contain business logic.

  • EJBs are used to encapsulate reusable business rules and logic.

  • EJBs are managed by the EJB container which provides services like security, transaction management and pooling.

  public class UserService {

    EntityManager em;

    public void registerUser(User user) {

    // Other business methods

The EJB is then injected into a Servlet/JSP and used.


Java Database Connectivity API is used to connect Java applications to databases. It provides a standard interface to execute SQL statements.


Java Naming and Directory Interface is used to access various naming and directory services like LDAP and DNS. It provides a standard API to look up and manage named objects.


Java Message Service API is used for sending messages between J2EE applications. It supports both point-to-point and publish-subscribe messaging models.


Remote Method Invocation allows a Java object to invoke methods of another Java object that exists in a different JVM. It provides remote communication between Java programs.


Common Object Request Broker Architecture is a standard that allows objects to communicate with one another regardless of their programming language or operating system.

The Role of UML in Software Architecture

Unified Modeling Language (UML) is a standardized modelling language used to visualize the design of software systems. UML can be used to model a software architecture in the following ways:

Class Diagrams

Class diagrams show the types of objects in the system and their relationships. They model the static view of an architecture by showing:

  • Classes

  • Attributes

  • Operations

  • Relationships between classes like association, generalization, dependency, etc.

Class diagrams help architects model the object-oriented design of the system.

Class Diagram - StarUML documentation

Component Diagrams

Component diagrams illustrate how software is organized into components and their dependencies. They show:

  • System components

  • Interfaces

  • Dependencies between components

This helps architects model the high-level design of the system in terms of its major components and interfaces.

What is Component Diagram?

Deployment Diagrams

Deployment diagrams depict how software components are deployed to physical nodes or devices. They show:

  • Nodes representing hardware

  • Artifacts representing deployable software

  • Connections showing communication between nodes

This models the physical deployment architecture of the system.

Deployment Diagram - StarUML documentation

Sequence Diagrams

Sequence diagrams illustrate how objects interact and messages are passed between them over time. They show:

  • Objects

  • Messages passed between objects

  • Time sequence

A sequence diagram for an emotion-based music player:

Unified Modeling Language (UML) | Sequence Diagrams - GeeksforGeeks