Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
14 views

Lab Manual - CS701

Uploaded by

amartya1820
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Lab Manual - CS701

Uploaded by

amartya1820
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 13

Shri Ram Institute of Science and Technology

Jabalpur

Department of
Computer Science Engineering
Software Architecture
CS701
VII sem

Submitted To
Dr. Meena Tiwari

Submitted By-
Name-
Roll no.-
INDEX

S.No EXPERIMENT NAME Date REMARK

1. Study report of any two design patterns.


2. Implementation of any two design patterns in
java.
3. Study report for any of the MVC based
Frameworks (J2EE).
4. Study report on EJB.
5. Implementation of a web application for a
system covering representative paper design of
the system using navigation, components,
interfaces, its deployment issue with UML.
6. A) Develop dynamic and interactive web client
using JSP, Scripting/Applets/ActiveX controls.
B) Develop server side programming with
database handling/
servlets/EJB/webservice on server side with
security aspects covered.
EXPERIMENT No.-1

AIM: Study report of any two design patterns.

Theory:
1. Creational: These patterns are designed for class instantiation. They can be either class-creation
patterns or object-creational patterns.

2. Structural: These patterns are designed with regard to a class's structure and composition. The main
goal of most of these patterns is to increase the functionality of the class (es) involved, without
changing much of its composition.

3. Behavioral: These patterns are designed depending on how one class communicates with others.

Type 1: Creational - The Singleton Design Pattern


The Singleton Design Pattern is a Creational pattern, whose objective is to create only one instance of a
class and to provide only one global access point to that object. One commonly used example of such a
class in Java is Calendar, where you cannot make an instance of that class. It also uses its
own getInstance()method to get the object to be used.
A class using the singleton design pattern will include,

1. A private static variable, holding the only instance of the class.

3
2. A private constructor, so it cannot be instantiated anywhere else.

3. A public static method, to return the single instance of the class.

There are many different implementations of singleton design.

1. Eager Instantiation

2. Lazy Instantiation

3. Thread-safe Instantiation

Design patterns are object oriented software design practices for solving common design problems and
they affect software quality. In this study, we investigate the relationship of design patterns and
software defects in a number of open source software projects. Design pattern instances are extracted
from the source code repository of these open source software projects. Software defect metrics are
extracted from the bug tracking systems of these projects. Using correlation and regression analysis on
extracted data, we examine the relationship between design patterns and software defects. Our findings
indicate that there is little correlation between the total number of design pattern instances and the
number of defects. However, our regression analysis reveals that individual design pattern instances as
a group have strong influences on the number of defects. Furthermore, we find that the number of
design pattern instances is positively correlated to defect priority. Individual design pattern instances
may have positive or negative impacts on defect priority.

4
EXPERIMENT No.-2

AIM: Implementation of any two design patterns in java.


Theory: - Design Patterns are very popular among software developers. A design pattern is a well-
described solution to a common software problem.

Some of the benefits of using design patterns are:

1. Design Patterns are already defined and provides industry standard approach to solve a recurring
problem, so it saves time if we sensibly use the design pattern. There are many java design patterns that
we can use in our java based projects.
2. Using design patterns promotes reusability that leads to more robust and highly maintainable code. It
helps in reducing total cost of ownership (TCO) of the software product.
3. Since design patterns are already defined, it makes our code easy to understand and debug. It leads to
faster development and new members of team understand it easily.

Java Design Patterns are divided into three categories - creational, structural, and behavioral design
patterns. This post serves as an index for all the java design patterns articles I have written so far.

1. Creational Design Patterns


Singleton Pattern
Factory Pattern
Abstract Factory Pattern
Builder Pattern
Prototype Pattern
2. Structural Design Patterns
Adapter Pattern
Composite Pattern
Proxy Pattern
Flyweight Pattern
Facade Pattern

5
Bridge Pattern
Decorator Pattern
3. Behavioral Design Patterns
Template Method Pattern
Mediator Pattern
Chain of Responsibility Pattern
Observer Pattern
Strategy Pattern
Command Pattern
State Pattern
Visitor Pattern
Interpreter Pattern
Iterator Pattern

6
EXPERIMENT No.-3

AIM: Study report for any of the MVC based Frameworks (J2EE).
Theory:- - The Model-View-Controller (MVC) is very useful for developing Interactive and Dynamic Web
Applications. It has become the most powerful and dominant Programming Paradigm for developing
large scale and Dynamic Web Applications. With MVC, developers can trust on design patterns that are
widely accepted as solutions for recurring problems and used to develop flexible, reusable and modular
Software. Applying the MVC design pattern to Web Applications is therefore complicated by the fact
that current technologies encourage developers to partition the application as early as in the design
phase. In this work we have developed a web-based application using MVC framework using Java Web
Architecture.

7
8
EXPERIMENT NO. 04

Aim: Study report on EJB.

Theory:- Enterprise Java Beans (EJB) is one of the several Java APIs for standard manufacture of
enterprise software. EJB is a server-side software element that summarizes business logic of an
application. Enterprise Java Beans web repository yields a runtime domain for web related software
elements including computer reliability, Java Servlet Lifecycle (JSL) management, transaction
procedure and other web services. The EJB enumeration is a subset of the Java EE enumeration.

The EJB enumeration was originally developed by IBM in 1997 and later adopted by Sun
Microsystems in 1999 and enhanced under the Java Community Process.

The EJB enumeration aims to provide a standard way to implement the server-side business software
typically found in enterprise applications. Such machine code addresses the same types of problems,
and solutions to these problems are often repeatedly re-implemented by programmers. Enterprise Java
Beans is assumed to manage such common concerns as endurance, transactional probity and security
in a standard way that leaves programmers free to focus on the particular parts of the enterprise
software at hand.

To run EJB application we need an application server (EJB Container) such as Jboss, Glassfish,
Weblogic, Websphere etc. It performs:

1. Life cycle management


2. Security
3. Transaction management
4. Object pooling

Types of Enterprise Java Beans


There are three types of EJB:
1. Session Bean: Session bean contains business logic that can be invoked by local, remote or
webservice client. There are two types of session beans:
(i) Stateful session bean and
9
(ii) Stateless session bean.

• (i) Stateful Session bean :


Stateful session bean performs business task with the help of a state. Stateful session bean can be
used to access various method calls by storing the information in an instance variable. Some of
the applications require information to be stored across separate method calls. In a shopping si te,
the items chosen by a customer must be stored as data is an example of stateful session bean.

• (ii) Stateless Session bean :


Stateless session bean implement business logic without having a persistent storage mechanism,
such as a state or database and can used shared data. Stateless session bean can be used in
situations where information is not required to used across call methods.

2. Message Driven Bean: Like Session Bean, it contains the business logic but it is invoked by
passing message.
3. Entity Bean: It summarizes the state that can be remained in the database. It is deprecated. Now, it
is replaced with JPA (Java Persistent API). There are two types of entity bean:

• (i) Bean Managed Persistence :


In a bean managed persistence type of entity bean, the programmer has to write the code for
database calls. It persists across multiple sessions and multiple clients.

(ii) Container Managed Persistence:


Container managed persistence are enterprise bean that persists across database. In container
managed persistence the container take care of database calls.

10
EXPERIMENT NO. 05

Aim: To Implementation of a web application for a system covering representative paper design of the
system using navigation, components, interfaces, its deployment issue with UML.

Theory: Traditional web applications do not support reverse engineering capabilities and it become difficult
to recover navigation, content from web applications. This paper describes web application modeling with
different perspective .Conventional modeling either use UML or MVC This papers proposes web
application modeling to recover these aspects with an hybrid approach using UML and MVC. Many
models have been defined for capturing different aspects of a user interface. There has been several
attempts to model a web application but none address the complete model recovery of web applications
Although UML has been widely accepted as a standard language to specify software models, it was not
designed with user interfaces in mind. This is precisely the reason why no particular model in UML is very
successful in capturing details of user interactions and interface designs related to UML modeling of web
applications and propose a hybrid method of modeling a structure of web page and simultaneously
navigational aspect of a web page. A combination of UML and MVC is proposed which bring out the best
of both. New stereotypes have been used to support the hybrid method of modeling. Our modeling method
tries to capture structural, navigational and functional aspects of web application.

11
EXPERIMENT NO. 06

Aim: A) Develop dynamic and interactive web client using JSP, Scripting/Applets/ActiveX controls.

Theory: The Dynamic Web

The Web has evolved from a network-based hypermedia distributed information system offering static
information to a marketplace for selling and buying goods and services. The increasingly sophisticated
applications to enable this marketplace require a technology for presenting dynamic information.

First generation solutions included CGI, which is a mechanism for running external programs through a
web server. The problem with CGI scripts is scalability; a new process is created for every request.

Second generation solutions included web server vendors providing plug-ins and APIs for their servers.
The problem is that their solutions were specific to their server products. For example, Microsoft provided
Active Server Pages (ASP) that made it easier to create dynamic content. However, their solution only
worked with Microsoft IIS or Personal Web Server. Therefore, if you wanted to use ASP you had to
commit yourself to Microsoft products and you would not be enjoying the freedom of selecting your
favorite web server and operating system!

Another second generation technology that is quite popular in enterprise computing is servlets. Servlets
make it easier to write server-side applications using Java technology. The problem with either CGI or
servlets, however, is that you have to follow the write, compile, and deploy life cycle.

JSP pages are a third generation solution that can be combined easily with some second generation
solutions, creating dynamic content, and making it easier and faster to build web-based applications that
work with a variety of other technologies: web servers, web browsers, application servers and other
development tools.

JavaServer Pages (JSP)

The JSP technology is an open, freely available specification developed by Sun Microsystems as an
alternative to Microsoft's Active Server Pages (ASP) technology, and a key component of the Java 2
Enterprise Edition (J2EE) specification. Many of the commercially available application servers (such as
BEA WebLogic, IBM WebSphere, Live JRun, Orion, and so on) already support JSP technology.
JSP versus ASP

JSP and ASP deliver similar functionality. They both use tags to allow embedded code in an HTML page,
session tracking, and database connection. Some of the trivial differences are:

• ASP pages are written in VBScript and JSP pages are written in the Java programming language.
Therefore, JSP pages are platform-independent and ASP pages are not.
• JSP pages use JavaBeans technology as the component architecture and ASP pages use ActiveX
components.
B) Develop server side programming with database handling/ servlets/EJB/webservice on server
side with security aspects covered.

12
Theory: - web servers deliver static contents that are indifferent to users' requests. Java servlets are server-
side programs (running inside a web server) that handle clients' requests and return
a customized or dynamic response for each request. The dynamic response could be based on user's input
(e.g., search, online shopping, online transaction) with data retrieved from databases or other applications,
or time-sensitive data (such as news and stock prices).
Java servlets typically run on the HTTP protocol. HTTP is an asymmetrical request-response protocol.

Server-Side Technologies

There are many (competing) server-side technologies available: Java-based (servlet, JSP, JSF, Struts,
Spring, Hibernate), ASP, PHP, CGI Script, and many others.

Java servlet is the foundation of the Java server-side technology, JSP (JavaServer Pages), JSF Pre-
requisites

(JavaServer Faces), Struts, Spring, Hibernate, and others, are extensions of the servlet technology.

HTML, Java Programming Language, HTTP and Apache Tomcat Server, SQL and MySQL Database
System, and many others.

Apache Tomcat Server

Servlets are server-side programs run inside a Java-capable HTTP server. Apache Tomcat Server is the
official Reference Implementation (RI) for Java servlet and JSP, provided free by open-source foundation
Apache

13

You might also like