Utkarsh Software Architecture
Utkarsh Software Architecture
Architecture
CS-701
BE: 4th Year
Certificate
DO’S
❖ While entering into the LAB students should wear their ID cards.
❖ Students should sign in the LOGIN REGISTER before entering into the laboratory.
❖ Students should come with observation and record note book to the laboratory.
❖ After completing the laboratory exercise, make sure to shut down the system properly.
DONT’S
4
CS-701
Software Architecture
5
CS-701
Software Architecture
6
CS-701
Software Architecture
Experiment: 01
Aim: Describe your major project architecture.
The architecture of the FLIP: Social Media Platform project is designed to be modular,
scalable, and user-friendly, ensuring that each component works seamlessly to provide a
posting experience with features like share, like, comment. Here’s a breakdown of its
architecture:
1. Overall Architecture Design
The architecture is based on a 3-tier structure comprising the Frontend Layer, Backend
Layer, and Database Layer. Each layer handles specific functions that contribute to the core
features and goals of the platform.
2. Frontend Layer (Client-Side)
The frontend is built with React.js and designed to offer a responsive, intuitive, and
interactive user interface. It provides users with a seamless experience across devices and
allows them to perform various functions related to posts creation, analysis, and
customization.
Key Components:
User Authentication Interface: Manages secure login and registration processes.
Homepage: Acts as a central hub where users can create, manage, and analyze their
posts.
Posts Builder Interface: Allows users to input their details and select templates and
build post.
Games Page : Offers game that user can play when they are offline.
Technologies:
React.js: Dynamic UI and component-based structure.
Bootstrap and CSS: Ensure responsive design and consistent styling.
3. Backend Layer (Server-Side)
The backend layer is built with Node.js and Express.js, handling business logic, API requests,
and interactions with the database. It serves as the processing hub for all user data.
7
CS-701
Software Architecture
Key Modules:
1. User Authentication and Authorization Module:
o Manages user registration, login, and session handling.
o Ensures secure access and data integrity through encrypted storage.
2. Profile Management Module:
o Stores and manages user profile data (name, age, bio, profile pictures, etc.).
o Manages relationships (e.g., friends, followers).
3. Content Creation and Management Module:
o Allows users to create, edit, and delete posts (text, photos, videos)
o Manages multimedia uploads (images, video, audio) and metadata.
4. Social Interaction Module:
o Manages user interactions with posts, including likes, comments, and shares.
o Ensures that users can react to posts and view reactions from others.
5. Search and Discovery Module:
o Facilitates searching of users, posts, groups, pages, and content.
o Recommends friends, pages, posts, groups, or events based on user
behaviour and interactions.
Technologies:
Node.js: Handles server-side logic and API requests.
Express.js: Simplifies routing and middleware integration.
4. Database Layer
The database layer is built using MongoDB, a NoSQL database, chosen for its flexibility and
scalability. It stores all user-related data, including posts details, user profiles. MongoDB’s
document-based structure suits the unstructured and semi-structured data involved in
posts.
Data Collections:
User Profiles: Stores user credentials, profile information, and preferences.
Posts: Stores each posts with its sections (experience, education, skills).
8
CS-701
Software Architecture
Experiment: 02
Aim: Define a use case most suitable for data flow, design and describe its architecture using
the data flow architecture.
In a data flow architecture, the system is structured around a pipeline or series of processes
that move and transform data as it flows from sources to consumers. This architecture is
highly suitable for applications that require continuous data collection, processing, analysis,
and output of actionable insights. It is especially useful in cases where real-time data
insights are critical, such as monitoring, prediction, or automation systems.
Definition: Data flow architecture is a design model in which data moves through a
sequence of processes or modules, each of which performs specific transformations
or analyses on the data.
Objective: Its purpose is to capture, transform, and analyze data as it flows through
the system, enabling decision-making or further actions based on continuous data
processing.
Structure: The architecture typically includes well-defined stages or layers, such as
data sources, data processing modules, storage layers, and output layers. Each
stage is designed to handle specific data-related tasks.
9
CS-701
Software Architecture
Fault Tolerance: By isolating each module, failures in one part of the pipeline can be
managed without disrupting the entire system. This is beneficial for robust, real-time
systems.
Real-Time Monitoring: Systems that need to provide real-time insights, like IoT-
based monitoring of environmental conditions, factory operations, or logistics.
Predictive Analytics: Applications that rely on data to forecast future outcomes, such
as predictive maintenance, disease prediction, or anomaly detection in systems.
Data Transformation Pipelines: ETL (Extract, Transform, Load) processes, where
data from multiple sources is collected, cleaned, transformed, and then loaded into a
data warehouse or data lake.
Automated Decision-Making Systems: Systems that need to respond automatically
to specific conditions, such as automated irrigation or alert systems in precision
agriculture.
Based on the project in your document titled FLIP: AI Posts Builder and Analyzer, a suitable
use case for a data flow architecture could involve the "Posts Analysis and
Recommendation" feature.
Overview
The purpose of this use case is to analyze a user's uploaded posts to provide AI-driven
feedback and recommendations for optimization. This feature helps improve the posts's
content to increase the user's chances of passing Applicant Tracking Systems (ATS) and
attracting recruiters.
10
CS-701
Software Architecture
Architecture Description
Frontend Layer:
o User Interface: Built with React.js, it provides posts upload, analysis initiation,
and result display functionalities.
o Data Input Forms: Collect posts files and user preferences (e.g., job role for
tailored analysis).
Backend Layer:
o API Gateway (Node.js & Express): Handles requests from the frontend,
passing posts data to the NLP processing module.
o Processing Engine:
NLP and Analysis Modules: Implemented using Python or integrated
with APIs like OpenAI for advanced recommendations and text
analysis.
Recommendation Service: Compares posts content with job-related
data to generate improvement suggestions.
Database Layer:
o Temporary Data Store (MongoDB): Holds extracted posts data during the
analysis phase.
o User Data Store: Stores user profiles, historical postss, and analysis reports
for future reference.
This architecture leverages the data flow model by ensuring that data moves efficiently from
user inputs through analysis and feedback, while maintaining minimal data retention in
temporary stores, thus prioritizing performance and scalability.
11
CS-701
Software Architecture
The Pipe and Filter architecture is a widely-used design pattern that structures an
application as a series of independent, ordered stages, where each stage processes data and
passes it to the next stage in a sequence. In this model, filters perform specific
transformations on data, while pipes act as the conduits that transfer data between these
filters.
Definition: The Pipe and Filter architecture divides a system into a sequence of
independent processing components (filters) connected by channels (pipes) through
which data flows.
Objective: Its main goal is to process data in stages, with each stage performing a
specific transformation, allowing for modular and reusable components that can be
combined flexibly.
Structure: Each filter performs a discrete, well-defined operation on the data, and
each pipe simply passes data from one filter to the next. This allows for streamlined,
predictable data processing.
12
CS-701
Software Architecture
Data Transformation Pipelines: Systems that need to process data in stages, such as
ETL (Extract, Transform, Load) systems, file processing, or data parsing.
Data Analytics and Machine Learning: Pipelines that involve preprocessing, feature
extraction, model training, and prediction can benefit from this pattern.
Natural Language Processing: NLP applications that process text through stages like
tokenization, stemming, filtering, and entity recognition.
Data Validation and Quality Control: Systems where data goes through multiple
validation and cleansing stages, making sure each stage meets specific criteria before
moving forward.
For the FLIP: AI Posts Builder and Analyzer project, the "Posts Formatting and Export"
feature is well-suited for a pipe and filter architecture. This feature involves processing posts
data through several stages to produce a downloadable, formatted posts file that meets
specific stylistic and structural requirements.
Overview
The purpose of this use case is to take the structured posts data (gathered from the user's
inputs or from parsed data) and apply a series of transformations (filters) to prepare it for
export. The filters include steps for applying templates, formatting sections, checking for
errors, and finalizing the document in various file formats (e.g., PDF, DOCX).
In the pipe and filter model, each processing step is a filter, which takes data as input,
transforms it, and then passes it along the pipeline for the next filter. This architecture
allows for flexibility in modifying or adding new filters without impacting the overall
workflow.
13
CS-701
Software Architecture
Architecture Description
This pipe and filter architecture allows for a clean, modular processing sequence that
enhances maintainability and scalability, ideal for handling various posts formats and export
options.
14
CS-701
Software Architecture
Experiment: 04
Aim: Describe the J2EE technology stack.
The J2EE (Java 2 Platform, Enterprise Edition) technology stack, now commonly known as
Java EE (Java Platform, Enterprise Edition), provides a set of specifications and APIs for
developing and running large-scale, multi-tiered, and distributed enterprise applications.
Here’s a breakdown of the main components and technologies in the J2EE stack:
1. Core Components
Java Servlets: These are server-side Java programs that handle HTTP requests and
responses. Servlets enable the development of dynamic web content.
JavaServer Pages (JSP): Built on top of Servlets, JSP allows developers to create
dynamically generated HTML, XML, or other types of content with embedded Java
code, which is particularly useful for presentation logic.
Enterprise JavaBeans (EJB): EJBs are server-side components that encapsulate
business logic. They offer features like transaction management, persistence, and
security, making them suitable for scalable enterprise applications.
2. Supporting Technologies
Java Message Service (JMS): JMS provides a messaging interface for sending and
receiving messages between distributed components, enabling asynchronous
communication in distributed applications.
Java Naming and Directory Interface (JNDI): JNDI enables applications to locate
resources and objects, such as EJBs, data sources, or JMS queues, within a
networked environment through directory and naming services.
JavaMail: JavaMail is used for sending and receiving emails. It’s often integrated into
J2EE applications to manage notifications or other email functionalities.
Java Transaction API (JTA) and Java Transaction Service (JTS): JTA and JTS provide
transaction management, allowing applications to perform complex operations on
databases while ensuring atomicity, consistency, isolation, and durability (ACID).
3. Web Services
15
CS-701
Software Architecture
Java API for XML Web Services (JAX-WS): Supports building SOAP-based web
services.
Java API for RESTful Web Services (JAX-RS): Supports RESTful web services using
JSON or XML.
Java API for XML Processing (JAXP): Enables applications to parse and transform
XML data.
Java Architecture for XML Binding (JAXB): Provides a framework for mapping XML
data to Java objects and vice versa.
4. Data Persistence
Java Persistence API (JPA): JPA provides a specification for managing relational data
using object-relational mapping (ORM). It allows developers to interact with
databases through Java objects.
JDBC (Java Database Connectivity): JDBC is used for connecting Java applications to
databases, allowing the execution of SQL queries and retrieval of data.
5. Security
Java API for WebSocket: Enables two-way communication between clients and
servers for real-time applications.
Java API for JSON Processing (JSON-P): Provides support for JSON processing, which
is essential for building RESTful APIs.
Java Management Extensions (JMX): JMX allows for monitoring and managing
resources such as applications, devices, and services.
7. Application Servers
Together, these components make the J2EE stack a robust solution for building scalable,
secure, and distributed enterprise applications.
16
CS-701
Software Architecture
Using the C4 Model (Context, Container, Component, and Code), here’s a documentation of
part of the FLIP project architecture. The C4 Model provides a layered approach to
documenting architecture, starting from a high-level view down to individual components.
Here, we’ll focus on documenting the Posts Creation and Recommendation module of the
FLIP project using the C4 Model, which is suitable for conveying different levels of
architectural detail.
1. Context Diagram
The context diagram provides an overview of the system in relation to its users and external
systems.
Description:
Users: Individuals who interact with the platform by creating accounts, posting
content, commenting, liking, and engaging with others.
Social Media Platform (System): The central system that provides all social media
features (post creation, interaction, messaging, etc.).
External Systems: External services such as third-party authentication providers
(e.g., Google, Facebook), payment gateways, or advertising systems.
2. Container Diagram
The container diagram shows the main components or "containers" in the FLIP system,
detailing how they interact and communicate.
Description:
Frontend (React.js): Provides the UI where users can input their data, view posts
analysis, and see recommendations.
Backend (Node.js/Express): Processes user inputs, conducts analysis, and provides
recommendations through several modules (NLP Processor, Posts Analysis API,
Recommendation Engine).
17
CS-701
Software Architecture
This component diagram zooms into the Backend container, breaking it down into its main
components and showing interactions between them.
Description:
Posts Analysis: Manages the flow of data between the NLP Processor and
Recommendation Engine, ensuring that data is processed correctly and sequentially.
Recommendation Engine: Provides specific feedback and actionable
recommendations based on the analyzed posts data. This includes keyword
optimization, skill gap identification, and other ATS compliance factors.
Database Connector: Manages interactions with MongoDB, ensuring secure storage
and retrieval of postss, user profiles, and reports.
This part zooms into the Recommendation Engine component, showing its main classes and
methods.
Description:
o User: Class representing a user. It stores user data (name, email, password,
roles, etc.).
Properties:
email: String
password: String
name: String
role: String
Context Diagram: Describes FLIP’s high-level interaction with users and external
services.
Container Diagram: Breaks down FLIP into main containers: Frontend, Backend,
Database, and NLP API.
Component Diagram: Focuses on backend components and interactions, especially
in the Posts Analysis and Recommendation system.
Code Diagram: Zooms into the Recommendation Engine, detailing its classes and
core functions.
The C4 Model allows us to document FLIP’s architecture from broad user interactions down
to the detailed component level, providing a clear view of each layer and its responsibilities.
18
CS-701
Software Architecture
This model is highly useful for both technical teams and stakeholders to understand the
structure and operation of the FLIP system.
Experiment: 06
Aim: Document ADLs. Show how and where you will use ADLs in your project.
Architecture Description Languages (ADLs) are formal languages used to represent and
analyze software and system architectures. They provide a structured way to describe the
components, relationships, and interactions within a system. ADLs serve as tools for both
documenting architectures and facilitating communication among stakeholders. By
employing ADLs, project teams can ensure a shared understanding of the system’s design,
enabling analysis, testing, and iterative refinement.
19
CS-701
Software Architecture
In the FLIP: Social Media Platform project, ADLs will play a crucial role in documenting and
analyzing various parts of the architecture. Here’s where ADLs can be used in this project:
We use AADL to define the system’s high-level structure, data flow, and components, as
illustrated in the previous example. AADL helps capture the posts analysis and
recommendation flow clearly. The system-level documentation provides an overview of
how data moves from one module to another, ensuring a modular, scalable design.
Where Used:
How Used:
Data Flow: We map data flows between NLP, Analysis, Recommendation, and
Report Generator modules to track how posts data is processed.
Component Interaction: Documenting interactions helps ensure each component’s
role is clearly defined, aiding in debugging and system enhancements.
Using UML diagrams (such as class diagrams, sequence diagrams, and activity diagrams) is
ideal for describing detailed behaviors within each component. For instance, each module in
the posts analysis subsystem has specific classes and methods that interact with other
modules. UML helps detail these interactions.
Where Used:
How Used:
Behavior Modeling: Sequence diagrams document how requests are processed step-
by-step, from user input to feedback generation.
Class Definitions: Class diagrams help structure classes like PostsBuilder,
TemplateManager, and ReportGenerator by detailing their methods and attributes.
20
CS-701
Software Architecture
Where Used:
Backend and Frontend Interaction: Acme diagrams represent how data requests
from the frontend (React.js) interact with backend (Node.js and MongoDB) services,
particularly during high-traffic processes like posts analysis.
Database Interaction: Acme documents how the backend interfaces with MongoDB
to store and retrieve posts data, ensuring database requests are optimized.
How Used:
Interaction Mapping: Acme maps the interaction between user requests and the
backend, useful for managing response times.
Scaling and Fault Tolerance: By understanding interactions, the architecture can be
designed to handle high user load and ensure robust fault tolerance.
Conclusion
By incorporating AADL, UML, and Acme into FLIP, we establish a robust documentation
framework, supporting modularity, scalability, and efficient debugging. Each ADL’s unique
strength helps communicate different facets of the system’s architecture, ensuring clarity
for developers, stakeholders, and future upgrades.
21
CS-701
Software Architecture
Experiment: 07
Aim: Apply CBAM, ATAM, ARID and ADD to your project and compare each of them with
the former.
CBAM focuses on the economic evaluation of architectural decisions, analyzing the trade-
offs between costs, benefits, and risks to maximize return on investment.
Identify Architectural Decisions: For FLIP, key decisions include the use of AI-driven
analysis modules, choice of cloud storage (MongoDB), and scalability solutions.
Estimate Costs and Benefits: Calculate the cost of implementing each feature (e.g.,
NLP, Recommendation Engine) and the benefit it brings (e.g., user engagement,
faster posts creation).
Evaluate Risks: Assess risks related to scalability, data security, and user data
handling, especially due to potential high loads from posts analysis requests.
Prioritize Investments: For instance, if AI-driven feedback and posts analysis are the
most beneficial features, resources can be prioritized for these.
Advantages of CBAM:
Limitations of CBAM:
22
CS-701
Software Architecture
ATAM is used to evaluate the architecture's ability to meet quality attribute goals (like
performance, scalability, security) and analyze trade-offs between these attributes.
Advantages of ATAM:
Limitations of ATAM:
ARID is a review process that uses stakeholder involvement to evaluate design decisions at
an intermediate stage, focusing on usability and alignment with requirements.
Early Review of Core Modules: Review components like the NLP and
Recommendation modules with stakeholders (e.g., project managers, developers,
users) to ensure they meet usability and functionality requirements.
Scenario-Based Evaluation: Create scenarios, such as “User uploads posts for
analysis,” to validate if current designs meet expected behaviors.
Gather Feedback: Get feedback on components’ usability, scalability, and
maintainability, making necessary adjustments early on.
Refine Design: Implement changes based on early feedback, ensuring the design
meets stakeholder requirements before full development.
Advantages of ARID:
23
CS-701
Software Architecture
Limitations of ARID:
Focused on Intermediate Design: Less useful for evaluating the final architecture.
Limited to Stakeholder Feedback: Primarily evaluates based on stakeholder needs
rather than broader system metrics.
Identify Primary Quality Attributes: Identify attributes like scalability, security, and
modularity that are critical to FLIP.
Decompose by Quality Attribute Goals: Break down the architecture into modules
(NLP, Analysis, User Interface) based on these quality attributes.
Assign Responsibilities: Define responsibilities within each module to meet quality
goals, such as implementing secure data handling within the database module to
meet security goals.
Refine Components: As each module’s responsibilities are defined, refine the
architecture to ensure that all quality attributes are addressed incrementally.
Advantages of ADD:
Limitations of ADD:
24
CS-701
Software Architecture
Comparison
Summary
CBAM would be useful for prioritizing investments and ensuring that the highest-
value features are developed first, especially given cost constraints.
ATAM is valuable for identifying and analyzing trade-offs among critical quality
attributes like scalability and security, ensuring a balance between performance and
security.
ARID is ideal for gathering early feedback, helping validate that the intermediate
design meets stakeholders' usability and functionality needs.
ADD allows systematic refinement of each module to meet quality goals
incrementally, particularly useful as we focus on modular components like NLP and
Recommendation engines.
Each method contributes uniquely, and using them in combination helps create a robust
architecture tailored to functional, economic, and quality-based goals for FLIP.
25
CS-701
Software Architecture
Experiment: 08
Aim: Draw basic UML diagrams of your project like: Use case, Class and Sequence diagram.
Sequence diagram
26
CS-701
Software Architecture
Class diagram
27
CS-701
Software Architecture
28
CS-701
Software Architecture
Experiment:09
29
CS-701
Software Architecture
Experiment:10
30
CS-701
Software Architecture
Experiment:11
31
CS-701
Software Architecture
Experiment:12
32
CS-701
Software Architecture
Experiment:13
Aim: Write a simple program to demonstrate the use of Servlets and JSP.
33
CS-701