Lab Manual Software Architecture Cs701
Lab Manual Software Architecture Cs701
Jabalpur (M.P.)
Enrolment Number:
Semester: VII
SUBMITTED BY SUBMITTED TO
Prof. Gulafsha Anjum
Software Architecture Lab Manual
Contents
Program Outcomes
Course Outcomes
List of Experiments
Vision and Mission of the Institute
Vision
society for betterment of their quality of life with best of the skills,
compassion and empathy.
Vision & Mission of Department
graduates so that they will cherish and nourish the society and the
nation with modern trends of digitization and blossom it with their
unparalleled technical expertise.
Program Outcomes
CO2 - To maintain a high-level structure of a software system that defines its components
and the relationships between them .and use key fundamentals, qualities, and terminologies
associated with software architecture.
CO3 - Represents the design decisions related to overall system structure and behavior as
well as understand and analyze how the system will achieve essential qualities such as
modifiability, availability, and security.
CO5 - To Ensure the system can handle growth in users, transactions, and data and Divide
the system into smaller, manageable, and interchangeable components or modules.
List of Experiments
2.
Create Class Diagram For Library Scenario.
3.
Create Use Case Diagram For Library Scenario.
4.
Introduction to Common Object Request Broker
Architecture (CORBA)
5.
Study Of Cost Benefit Analysis Method (CBAM).
6.
Study Of Spiral Model.
7.
Study Of Call And Return Architecture.
Designing a database for a railway reservation system involves considerations such as user
management, train schedules, booking and cancellation processes, seat allocation and real-time
updates.
The database must handle high transaction volumes which ensures fast response times and
maintain data integrity and accuracy.
1. User Table
UserID (Primary Key): It is an Unique identifier for each user.
Username: User's display name.
Email: User's email address for contact and login.
PasswordHash: Securely hashed password for user authentication.
PhoneNumber: User's contact number.
Address: User's address details.
CreatedAt: Timestamp when the user account was created.
2. Train Table
TrainID (Primary Key): Unique identifier for each train.
TrainNumber: Official train number.
TrainName: Name of the train.
RouteID: Identifier for the route taken by the train.
ScheduleID: Identifier for the train's schedule.
3. Route Table
RouteID (Primary Key): Unique identifier for each route.
SourceStationID: Identifier for the source station.
DestinationStationID: Identifier for the destination station.
Distance: Distance between source and destination stations.
4. Station Table
StationID (Primary Key): Unique identifier for each station.
StationName: Name of the station.
Location: Geographical location of the station.
5. Schedule Table
ScheduleID (Primary Key): Unique identifier for each schedule.
TrainID: Identifier for the train.
DepartureTime: Scheduled departure time.
ArrivalTime: Scheduled arrival time.
DaysOfOperation: Days on which the train operates.
6. Booking Table
BookingID (Primary Key): Unique identifier for each booking.
UserID: Identifier for the user who made the booking.
TrainID: Identifier for the booked train.
ScheduleID: Identifier for the train's schedule.
BookingStatus: Status of the booking (e.g., confirmed, cancelled, waitlisted).
BookingDate: Date when the booking was made.
TotalAmount: Total amount paid for the booking.
7. Seat Table
SeatID (Primary Key): Unique identifier for each seat.
TrainID: Identifier for the train.
SeatNumber: Seat number within the train.
ClassType: Type of class (e.g., sleeper, AC, general).
AvailabilityStatus: Availability status of the seat (e.g., available, booked).
Online Railway ticket reservation is very useful nowadays. This is very important to design a good-
working system software for ticket booking and related transactions. To design it, full-track
documentation of models(ER, DFD, Class, Use-case, Activity, Sequence) is required as per as
software development is concerned.
Level 0 DFD:
Required Diagrams:
Entity Relationship(ER) Diagram:
ER diagram displays the relations between the various entities(classes and their attributes) stored in
the database. ER diagrams are very important for any database project. This diagram shows the
communication between entities and their attributes.
Level 1 DFD:
Object: 2 Create Class Diagram For Library Scenario
Class Diagram:
These diagrams describe the operation and attributes of a class with imposed constraints in the
system. In this article the classes to be considered are ‘payment’, ‘train’, ‘passenger’, ‘ticket’,
‘railway reservation system’, ‘admin’.
PNR_no, status,
payment type, train new Ticket, delete
ticket
code search train, tickets
date of journey
railway
reservation system response
system
formDetails,
Admin ID, name cancellationForm,
refundAmt
Object: 3 Create Use Case Diagram For Library Scenario.
Use Case Diagram for Library Management System
visually map out the relationships and interactions. Below is the textual description of what the
diagram would look like:
1. Actors:
User (Staff or Student)
Librarian
2. Use Cases:
Register New User
Issue Library Card
Request New Book
Reserve Book
Renew Book
Pay Fine
Fill Feedback Form
Manage Records
Delete Records
Update Database
3. System Boundary:
The system boundary will encompass all the use cases mentioned above.
Below is the use case diagram of a Library Management System
1. User who registers himself as a new user initially is regarded as staff or student for the library
system.
For the user to get registered as a new user, registration forms are available that is needed to
be fulfilled by the user.
After registration, a library card is issued to the user by the librarian. On the library card, an
ID is assigned to cardholder or user.
2. After getting the library card, a new book is requested by the user as per there requirement.
3. After, requesting, the desired book or the requested book is reserved by the user that means no
other user can request for that book.
4. Now, the user can renew a book that means the user can get a new due date for the desired book
if the user has renewed them.
5. If the user somehow forgets to return the book before the due date, then the user pays fine. Or if
the user forgets to renew the book till the due date, then the book will be overdue and the user
pays fine.
6. User can fill the feedback form available if they want to.
7. Librarian has a key role in this system. Librarian adds the records in the library database about
each student or user every time issuing the book or returning the book, or paying fine.
8. Librarian also deletes the record of a particular student if the student leaves the college or
passed out from the college. If the book no longer exists in the library, then the record of the
particular book is also deleted.
Common Object Request Broker Architecture (CORBA) could be a specification of a
regular design for middleware. It is a client-server software development model.
Using a CORBA implementation, a shopper will transparently invoke a way on a server object, which
may air a similar machine or across a network. The middleware takes the decision, associated is to
blame for finding an object that will implement the request, passing it the parameters, invoking its
methodology, and returning the results of the invocation. The shopper doesn’t need to remember
wherever the item is found, its programming language, its software package or the other aspects that
don’t seem to be a part of the associated object’s interface.
Different parts communicate victimization ORB. ORB is additionally referred to as the item bus. An
associate example of the application interface is a distributed document facility. In a very domain
interface, it will have domain dependent services, for instance, producing domain.
Object interface has some domain freelance services:
1. Naming Service:
Naming service is additionally known as a white page service. Victimization naming service
server-name will be searched, and its location or address pointed out.
2. Trading Service:
Commercialism service is additionally known as a yellow page service. Victimization
commercialism service a selected service will be searched. This is often corresponding to looking
out a service like an automobile store in a very yellow page directory.
The Broker pattern is particularly useful in helping you follow these design principles:
Divide and conquer. The remote objects can be independently designed.
Increase reusability. It is typically possible to design the remote objects so that other systems
can use them too.
Increase reuse. You may be able to reuse remote objects that others have created.
Design for flexibility. The broker objects can be updated as required, or you can redirect the
proxy to communicate with a different remote object.
Design for portability. You can write clients for new platforms while still accessing brokers and
remote objects on other platforms.
Design defensively. You can provide careful assertion checking in the remote objects.
Object: 5 Study Of Cost Benefit Analysis Method (CBAM).
1. Hardware cost –
Hardware cost includes actual purchase and peripherals (external devices) that are
connected to computer. For example, printer, disk drive etc. Actually, finding actual
cost of hardware is generally more difficult especially, when system is shared by
various users so as to compared to a system which dedicated stand alone . In some case,
best way is to treat it as operating cost.
2. Personnel costs –
Personnel costs includes EDP staff salaries and benefits as well as pay for those who are
involved in process of development of system. Cost occurred during development of
system which are one time costs and are also called development cost. Once system is
installed, cost of operating and maintaining system becomes recurring cost that one has
to pay very frequently based on requirement.
3. Facility cost –
Facility cost is amount of money that is spent in preparation of a site that is physical
where application or computer will be in operation. This includes wiring, flooring,
lighting and air conditioning. These costs are treated as one- time costs and are included
into overall cost estimate of candidate system.
4. Operating costs –
These includes all costs associated with day-to-day(everyday) operation of system and
amount depends on number of shifts, nature of applications. There are various ways of
covering operating costs. One approach is to treat operating costs as an overhead.
Another approach is to charge money from each authorized user for amount of
processing they require from system. Amount charged is based on computer time or
time they spend on system, staff time ad volume of output produced .
5. Supply costs –
Supply cost are variable costs that increase with increased use of paper, disks and like.
They should be estimated and included in overall cost of system.
A system is also expected to provide health benefits. First task is to identify each benefit
and then assign some value to it for purpose of cost/ benefit analysis. Benefits may be
tangible and intangible, direct or indirect.
Two major benefits are improving performance and minimizing cost of processing of
system. The performance category emphasizes improvement in accuracy of or access to
information and easier access to system by authorized users. Minimizing costs through an
efficient system – error control or reduction of staff- is a benefit that should be measured
and included in cost/benefit analysis.
The determination of costs and benefit entails following steps :
1. Identify the costs and benefits pertaining to given project.
2. Categorize the various costs and benefits for analysis.
3. Select a method of evaluation.
4. Interpret the results of the analysis.
5. Take action.
Object: 6 Study Of Spiral Model.
Spiral Model
The spiral model, initially proposed by Boehm, is an evolutionary software process model
that couples the iterative feature of prototyping with the controlled and systematic aspects of
the linear sequential model. It implements the potential for rapid development of new
versions of the software. Using the spiral model, the software is developed in a series of
incremental releases. During the early iterations, the additional release may be a paper model
or prototype. During later iterations, more and more complete versions of the engineered
system are produced.
Objective setting: Each cycle in the spiral starts with the identification of purpose for that
cycle, the various alternatives that are possible for achieving the targets, and the constraints
that exists.
Risk Assessment and reduction: The next phase in the cycle is to calculate these various
alternatives based on the goals and constraints. The focus of evaluation in this stage is located
on the risk perception for the project.
Development and validation: The next phase is to develop strategies that resolve
uncertainties and risks. This process may include activities such as benchmarking, simulation,
and prototyping.
Planning: Finally, the next step is planned. The project is reviewed, and a choice made
whether to continue with a further period of the spiral. If it is determined to keep, plans are
drawn up for the next step of the project.
The development phase depends on the remaining risks. For example, if performance or user-
interface risks are treated more essential than the program development risks, the next phase
may be an evolutionary development that includes developing a more detailed prototype for
solving the risks.
The risk-driven feature of the spiral model allows it to accommodate any mixture of a
specification-oriented, prototype-oriented, simulation-oriented, or another type of approach.
An essential element of the model is that each period of the spiral is completed by a review
that includes all the products developed during that cycle, including plans for the next cycle.
The spiral model works for development as well as enhancement projects.
Advantages
Disadvantages
Conclusion
Spiral Model is a valuable choice for software development projects where risk
management is on high priority. Spiral Model deliver high-quality software by promoting
risk identification, iterative development and continuous client feedback. When a project is
vast in software engineering, a spiral model is utilized.
Object: 7 Study Of Call And Return Architectures
Characteristics:
Variants:
1. Main-Subroutine Architecture:
2. Layered Architecture:
It is used to create a program that is easy to scale and modify. Many sub-styles exist within
this category. Two of them are explained below.
Remote procedure call architecture: This components is used to present in a main
program or sub program architecture distributed among multiple computers on a
network.
Main program or Subprogram architectures: The main program structure
decomposes into number of subprograms or function into a control hierarchy. Main
program contains number of subprograms that can invoke other components.
Implement the System Here’s a sample Python implementation:
# Main Program
def main():
print("Bank Account Management System")
balance = 0 # Initial balance
while True:
print("\nMenu:")
print("1. Deposit")
print("2. Withdraw")
print("3. Check Balance")
print("4. Exit")
choice = int(input("Enter your choice: "))
if choice == 1:
amount = float(input("Enter amount to deposit: "))
balance = deposit(balance, amount)
elif choice == 2:
amount = float(input("Enter amount to withdraw: "))
balance = withdraw(balance, amount)
elif choice == 3:
check_balance(balance)
elif choice == 4:
print("Exiting...")
break
else:
print("Invalid choice! Please try again.")
# Subroutine: Deposit
def deposit(balance, amount):
balance += amount
print(f"Deposited {amount}. New Balance: {balance}")
return balance
# Subroutine: Withdraw
def withdraw(balance, amount):
if amount > balance:
print("Insufficient funds!")
else:
balance -= amount
print(f"Withdrew {amount}. New Balance: {balance}")
return balance
Characteristics-
1. Repository Architecture:
o All components share and interact with a common data store.
o Used in systems where data consistency and integrity are critical.
o Example: Version control systems (e.g., Git), databases.
2. Blackboard Architecture:
o Components work collaboratively by posting results to a shared blackboard
(data structure) and reacting to data changes.
o Typically used in AI, machine learning, and knowledge-based systems.
o Example: Speech recognition systems, image processing.
Advantages
Disadvantages
1. Bottlenecks:
o The central data repository can become a performance bottleneck.
2. Dependency on Data Store:
o Failure of the central data store can halt the entire system.
3. Data Latency:
o Delays in updating or retrieving data can impact overall performance.
Use Cases
1. Enterprise Systems:
o ERP and CRM systems with centralized databases.
2. Knowledge-Based Systems:
o Collaborative systems like AI or problem-solving environments.
3. Data Warehousing:
o Systems for data mining and analytics with centralized storage.
ADD uses quality attributes (e.g., usability, performance, reliability) as the primary drivers
for architectural decisions, ensuring that the resulting architecture aligns closely with the
system’s non-functional requirements.
Limitations of ADD
1. Complexity:
o Requires expertise in understanding quality attributes and architectural patterns.
2. Subjectivity:
o The success of ADD heavily depends on the accuracy of quality attribute
prioritization.
3. Time-Consuming:
o Iterative nature may extend the design phase.
Object: 10 To Study of MVC Frameworks.
1. Introduction
The Model-View-Controller (MVC) architectural pattern is widely used for developing modern web
applications. It separates an application into three interconnected components:
MVC frameworks help streamline the development process by enforcing this separation of concerns,
leading to cleaner, more maintainable code.
Features:
o Annotation-based configuration for routing (@Controller, @RequestMapping).
o Integration with Spring modules like Spring Security and Spring Boot.
o Supports RESTful services.
Advantages:
o Strong enterprise-level support.
o Flexible view technologies (JSP, Thymeleaf).
Use Cases:
o Enterprise-grade web applications, REST APIs.
b. Django (Python)
Features:
o Built-in ORM (Object-Relational Mapping) for database operations.
o Automatic admin interface generation.
o Strong focus on rapid development.
Advantages:
o Simple syntax and configuration.
o Batteries-included philosophy (comes with many built-in tools).
Use Cases:
o Content management systems (CMS), data-driven applications.
Features:
o Convention over configuration (CoC) and Don’t Repeat Yourself (DRY) principles.
o Built-in ActiveRecord ORM for database management.
o Extensive ecosystem with prebuilt modules (gems).
Advantages:
o Quick prototyping.
o Strong community support.
Use Cases:
o Startups, social networking applications.
1. Request Handling: The user sends a request that is intercepted by the DispatcherServlet.
2. Controller Processing: The request is routed to a specific controller.
3. Business Logic: The controller processes the request, interacts with the model, and prepares
data.
4. View Resolution: The controller selects a view to render the response.
5. Response: The view generates the response for the user.
1. Model:
java
Copy code
public class Book {
private Long id;
private String title;
private String author;
// Getters and Setters
}
2. Controller:
java
Copy code
@Controller
public class BookController {
@RequestMapping("/books")
public String getBooks(Model model) {
List<Book> books = bookService.getAllBooks();
model.addAttribute("books", books);
return "book-list"; // View name
}
}
3. View (JSP):
html
Copy code
<table>
<tr>
<th>Title</th>
<th>Author</th>
</tr>
<c:forEach var="book" items="${books}">
<tr>
<td>${book.title}</td>
<td>${book.author}</td>
</tr>
</c:forEach>
</table>
1. Separation of Concerns:
o Clear separation between logic, presentation, and user interaction.
2. Maintainability:
o Easier to debug, update, and extend.
3. Reusability:
o Components like Models and Controllers can be reused in different parts of the
application.
4. Scalability:
o Well-suited for large-scale applications.
7. Limitations