Professional Documents
Culture Documents
2
Steps to draw the Use-Case Diagram using Rational Rose.
AIM: Understanding the fundamentals of Software architecture, qualities & its terminologies.
The architecture of a system describes its major components, their relationships (structures), and how they
interact with each other. Software architecture and design includes several contributory factors such as Business
strategy, quality attributes, human dynamics, design, and IT environment.
We can segregate Software Architecture and Design into two distinct phases: Software Architecture and
Software Design. In Architecture, nonfunctional decisions are cast and separated by the functional
requirements. In Design, functional requirements are accomplished.
Software Architecture
Architecture serves as a blueprint for a system. It provides an abstraction to manage the system complexity
and establish a communication and coordination mechanism among components.
• It defines a structured solution to meet all the technical and operational requirements, while optimizing the
common quality attributes like performance and security.
• Further, it involves a set of significant decisions about the organization related to software development and
each of these decisions can have a considerable impact on quality, maintainability, performance, and the overall
success of the final product. These decisions comprise of –
o Selection of structural elements and their interfaces by which the system is composed.
o Behavior as specified in collaborations among those elements.
o Composition of these structural and behavioral elements into large subsystem.
o Architectural decisions align with business objectives.
o Architectural styles guide the organization.
Software Design
Software design provides a design plan that describes the elements of a system, how they fit, and work together
to fulfill the requirement of the system. The objectives of having a design plan are as follows –
• To negotiate system requirements, and to set expectations with customers, marketing, and management
personnel.
• Act as a blueprint during the development process.
• Guide the implementation tasks, including detailed design, coding, integration, and testing.
It comes before the detailed design, coding, integration, and testing and after the domain analysis, requirements
analysis, and risk analysis.
Goals of Architecture
The primary goal of the architecture is to identify requirements that affect the structure of the application. A
well-laid architecture reduces the business risks associated with building a technical solution and builds a bridge
between business and technical requirements.
Some of the other goals are as follows –
• Expose the structure of the system, but hide its implementation details.
• Realize all the use-cases and scenarios.
• Try to address the requirements of various stakeholders.
• Handle both functional and quality requirements.
• Reduce the goal of ownership and improve the organization’s market position.
• Improve quality and functionality offered by the system.
• Improve external confidence in either the organization or system.
Limitations
Software architecture is still an emerging discipline within software engineering. It has the following limitations
–
• Lack of tools and standardized ways to represent architecture.
• Lack of analysis methods to predict whether architecture will result in an implementation that meets the
requirements.
• Lack of awareness of the importance of architectural design to software development.
• Lack of understanding of the role of software architect and poor communication among stakeholders.
• Lack of understanding of the design process, design experience and evaluation of design.
EXPERIMENT NO. 2
Hardware Requirements:
Pentium 4 processor (2.4 GHz), 128 Mb RAM, Standard keyboard n mouse, colored monitor.
Software Requirements:
Theory:
According to the UML specification a use case diagram is ―a diagram that shows the relationships among
actors and use cases within a system.‖ Use case diagrams are often used to:
• Provide an overview of all or part of the usage requirements for a system or organization in the form
of an essential model or a business model
• Communicate the scope of a development project
• Model your analysis of your usage requirements in the form of a system use case model
Use case models should be developed from the point of view of your project stakeholders and not from the
(often technical) point of view of developers. There are guidelines for:
1.UseCases
A use case describes a sequence of actions that provide a measurable value to an actor. A use case is drawn as
a horizontal ellipse on a UML use case diagram.
2. Actors
An actor is a person, organization, or external system that plays a role in one or more interactions with your
system (actors are typically drawn as stick figures on UML Use Case diagrams).
3. Relationships
There are several types of relationships that may appear on a use case diagram:
Associations are depicted as lines connecting two modeling elements with an optional open- headed
arrowhead on one end of the line indicating the direction of the initial invocation of the relationship.
Generalizations are depicted as a close-headed arrow with the arrow pointing towards the more general
modeling element.
1. Indicate An Association Between an Actor and A Use Case If the Actor Appears Within the Use
Case Logic
2. Avoid Arrowheads on Actor-Use Case Relationships
3. Apply <<include>> When You Know Exactly When to Invoke the Use Case
4. Apply <<extend>> When A Use Case May Be Invoked Across Several Use Case Steps
5. Introduce <<extend>> associations sparingly
6. Generalize Use Cases When a Single Condition Results in Significantly New Business Logic
7. Do Not Apply <<uses>>, <<includes>>, or<<extends>>
8. Avoid More Than Two Levels of Use Case Associations
9. Place An Included Use Case to The Right of The Invoking Use Case
10. Place An Extending Use Case Below the Parent Use Case
11. Apply the ― IsLike‖ Rule to Use Case Generalization
12. Place an Inheriting Use Case Below The Base UseCase
13. Apply the ―IsLike‖ Rule to Actor Inheritance
14. Place an Inheriting Actor Below the Parent Actor
The rectangle around the use cases is called the system boundary box and as the name suggests it indicates the
scope of your system – the use cases inside the rectangle represent the functionality that you intend to
implement.
We start by identifying as many actors as possible. You should ask how the actors interact with the system to
identify an initial set of use cases. Then, on the diagram, you connect the actors with the use cases with which
they are involved. If actor supplies information, initiates the use case, or receives any information as a result
of the use case, then there should be an association between them.
Procedure (for rational rose):
Enter the name of new Use Case file in the space provided and then click on thatfile name.
You can now use the window that appears on right hand side to draw your UseCase diagram
using the buttons provided on the verticaltoolbar.
Conclusion: The use case diagram was made successfully by following the steps described above.
Some Sample Use Case Diagrams are given below for illustration purpose:
Authenticat
ion
User/B Searchi
T ng
Data
Transfer
Administra
tor
MobilityManage
ment
Signalling
Management
Software Updation
Experiment 3
Aim: Demonstrate a struts application which accepts user inputs and show input values.
We are going to create a registration form using struts UI tags and store these
information into the oracle database.
register-success.jsp
1. <%@ taglib uri=”/struts-tags” prefix=”s” %>
2. Welcome, <s:property value=”name”></s:property>
register-error.jsp
1. <%@ taglib uri=”/struts-tags” prefix=”s” %>
2. Sorry, some error 11ccurred!
3. <s:include value=”index.jsp”></s:include>
Experiment 4
For creating the hibernate application in Eclipse IDE, we need to follow the following
steps:
Create the java project by File Menu – New – project – java project . Now specify
the project name e.g. firsthb then next – finish .
To add the jar files Right click on your project – Build path – Add external
archives. Now select all the jar files as shown in the image given below then click
open.
To create the persistent class, Right click on src – New – Class – specify the class
with package name
1. package com.javatpoint.mypackage;
2.
3. public class Employee {
4. private int id;
5. private String firstName,lastName;
6.
7. public int getId() {
8. return id;
9. }
10. public void setId(int id) {
11. this.id = id;
12. }
13. public String getFirstName() {
14. return firstName;
15. }
16. public void setFirstName(String firstName) {
17. this.firstName = firstName;
18. }
19. public String getLastName() {
20. return lastName;
21. }
22. public void setLastName(String lastName) {
23. this.lastName = lastName;
24. }
25. }
To create the mapping file, Right click on src – new – file – specify the file name
(e.g. employee.hbm.xml) – ok.
The configuration file contains all the informations for the database such as
connection_url, driver_class, username, password etc. To create the configuration file,
right click on src – new – file. Now specify the configuration file name e.g. hibernate.cfg.xml.
12) Create the class that retrieves or stores the persistent object
In this class, we are simply storing the employee object to the database.
1. package com.javatpoint.mypackage;
2.
3. import org.hibernate.Session;
4. import org.hibernate.SessionFactory;
5. import org.hibernate.Transaction;
6. import org.hibernate.boot.Metadata;
7. import org.hibernate.boot.MetadataSources;
8. import org.hibernate.boot.registry.StandardServiceRegistry;
9. import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
10.
11. public class StoreData {
12.
13. public static void main( String[] args )
14. {
15. StandardServiceRegistry ssr = new StandardServiceRegistryBuilder().configure
(“hibernate.cfg.xml”).build();
16. Metadata meta = new MetadataSources(ssr).getMetadataBuilder().build();
17.
18. SessionFactory factory = meta.getSessionFactoryBuilder().build();
19. Session session = factory.openSession();
20. Transaction t = session.beginTransaction();
21.
22. Employee e1=new Employee();
23. e1.setId(1);
24. e1.setFirstName(“Gaurav”);
25. e1.setLastName(“Chawla”);
26.
27. session.save(e1);
28. t.commit();
29. System.out.println(“successfully saved”);
30. factory.close();
31. session.close();
32. }
33. }
Before running the application, determine that directory structure is like this.
To run the hibernate application, right click on the StoreData class – Run As – Java
Application.
Experiment 5
To develop stateless bean application, we are going to use Eclipse IDE and glassfish
3 server.
To create EJB application, you need to create bean component and bean client.
To create the stateless bean component, you need to create a remote interface and a bean class.
File: AdderImplRemote.java
1. package com.javatpoint;
2. import javax.ejb.Remote;
3. @Remote
4. public interface AdderImplRemote {
5. int add(int a,int b);
6. }
File: AdderImpl.java
2. package com.javatpoint;
3. import javax.ejb.Stateless;
4.
5. @Stateless(mappedName=”st1”)
6. public class AdderImpl implements AdderImplRemote {
7. public int add(int a,int b){
8. return a+b;
9. }
10. }
2) Create stateless bean client
The stateless bean client may be local, remote or webservice client. Here, we are
going to create remote client. It is console based application.
File: AdderImpl.java
1. package com.javatpoint;
2. import javax.naming.Context;
3. import javax.naming.InitialContext;
4. public class Test {
5. public static void main(String[] args)throws Exception {
6. Context context=new InitialContext();
7. AdderImplRemote remote=(AdderImplRemote)context.lookup(“st1”);
8. System.out.println(remote.add(32,32));
9. }
10. }
Output
Output: 64
Experiment 6
1. ng-init
<!DOCTYPE html>
<html >
<head>
<script src="~/Scripts/angular.js"></script>
</head>
<body >
<div ng-app ng-init="greet='Hello World!'; amount= 100; myArr
= [100, 200]; person = { firstName:'Steve', lastName :'Jobs'}">
{{amount}} <br />
{{myArr[1]}} <br />
{{person.firstName}}
</div>
</body>
</html>
2. ng-model
3. ng-bind
The ng-bind directive binds the model property declared via $scope or ng-model directive or the
result of an expression to the HTML element.
<!DOCTYPE html>
<html >
<head>
<script src="~/Scripts/angular.js"></script>
</head>
<body ng-app="">
<div>
5 + 5 = <span ng-bind="5 + 5"></span> <br />
4. ng-repeat
The ng-repeat directive repeats HTML once per each item in the specified array collection
<!DOCTYPE html>
<html>
<head>
<script src="~/Scripts/angular.js"></script>
<style>
div {
border: 1px solid green;
width: 100%;
height: 50px;
display: block;
margin-bottom: 10px;
text-align:center;
background-color:yellow;
}
</style>
</head>
<body ng-app="" ng-init="students=['Bill','Steve','Ram']">
<ol>
<li ng-repeat="name in students">
{{name}}
</li>
</ol>
<div ng-repeat="name in students">
{{name}}
</div>
</body>
</html>
5. ng-disabled
The ng-disabled directive disables an HTML element, based on the Boolean value returned from
the specified expression. If an expression returns true the element will be disabled, otherwise
not.
<!DOCTYPE html>
<html>
<head>
<script src="~/Scripts/angular.js"></script>
<style>
div {
width: 100%;
height: 50px;
display: block;
margin: 15px 0 0 10px;
}
</style>
</head>
<body ng-app ng-init="checked=true" >
Click Me: <input type="checkbox" ng-model="checked" /> <br />
<div>
New: <input ng-if="checked" type="text" />
</div>
<div>
Read-only: <input ng-readonly="checked" type="text"
value="This is read-only." />
</div>
<div>
Disabled: <input ng-disabled="checked" type="text"
value="This is disabled." />
</div>
</body>
</html>
Experiment 7
Architectural Study of Java Message Service (JMS) will be submitted by students which
comprised of:
Experiment 8
Architectural Study of Remote Method Invocation (RMI) will be submitted by students which
comprised of: