100% found this document useful (1 vote)
3K views

Skill Development Lab

The document describes the mission, vision, objectives and curriculum of the Skill Development Lab course for computer science students. The course aims to help students understand software as a product, current industry requirements, and apply software development techniques to real-life applications through experiments mapping to program outcomes and program specific outcomes. The experiments cover topics like software development life cycles, design patterns, standards and a case study.

Uploaded by

shubh agrawal
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
3K views

Skill Development Lab

The document describes the mission, vision, objectives and curriculum of the Skill Development Lab course for computer science students. The course aims to help students understand software as a product, current industry requirements, and apply software development techniques to real-life applications through experiments mapping to program outcomes and program specific outcomes. The experiments cover topics like software development life cycles, design patterns, standards and a case study.

Uploaded by

shubh agrawal
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 42

Gyan Ganga Institute of Technology and

Sciences, Jabalpur

Department of Computer Science and


Engineering

COURSE FILE
2019-20
Skill Development Lab

(CS-606)
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Mission and Vision of the Institution: 

Vision of Institute:

Initially to seek autonomy and eventually grow the Institute into a renowned University by:
 Imparting the best technical and professional education to the students of the
Institute.
 Developing all the Departments of the Institute as Centers of Excellence.
 Creating the most congenial and cordial environment of Teaching, Learning
and Research in the Institute.
 Conceiving world - class Education, Ethics and Employability for students in
global perspective.
Mission of Institute
To explore and ensure the best environment to transform students into creative,
knowledgeable, principled engineers and managers compatible with their abilities in ever-
changing socio-economic and competitive scenario by:
 Imparting intensive teaching and training through latest technology
 Motivating the teachers for higher learning and innovative research activities
with social services.
 Generating maximum opportunities for placement of students in National,
Multi-National companies and nurturing entrepreneurship quality.
 Producing highly intellectual citizens through technical education to constitute
an elegant society and meeting social challenges.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Mission  and  Vision  of  the  Department: 

Vision

 To be an innovative and research oriented leading education centre in computer


science and engineering.
 To produce skilful and employable computer science graduates to meet upcoming
social challenges with moral and ethics.
Mission

 To impart intensive, innovative teaching and training through state of art


technology for achieving excellence.
 To associate with industries for identification of social needs and seize
opportunities for software development in live training and sustainable projects of
social challenges.
 Continuous knowledge up-gradation of students, staff, faculty through research,
trainings, seminars, workshops, conferences, webinars and higher studies.
 To impart knowledge of project management, commercial viability and code of
conducts for Engineers
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Program Objectives

Engineering Graduates will be able to:

1. Engineering knowledge: Apply the knowledge of mathematics, science,


engineeringfundamentals, and an engineering specialization to the solution of
complex engineeringproblems.
2. Problem analysis: Identify, formulate, review research literature, and analyze
complexengineering problems reaching substantiated conclusions using first
principles of mathematics,natural sciences, and engineering sciences.
3. Design/development of solutions: Design solutions for complex engineering
problems anddesign system components or processes that meet the specified needs
with appropriateconsideration for the public health and safety, and the cultural,
societal, and environmentalconsiderations.
4. Conduct investigations of complex problems: Use research-based knowledge
and researchmethods including design of experiments, analysis and interpretation of
data, and synthesis of theinformation to provide valid conclusions.
5. Modern tool usage: Create, select, and apply appropriate techniques, resources,
and modernengineering and IT tools including prediction and modeling to complex
engineering activitieswith an understanding of the limitations.
6. The engineer and society: Apply reasoning informed by the contextual knowledge
to assesssocietal, health, safety, legal and cultural issues and the consequent
responsibilities relevant tothe professional engineering practice.
7. Environment and sustainability: Understand the impact of the professional
engineeringsolutions in societal and environmental contexts, and demonstrate the
knowledge of, and needfor sustainable development.
8. Ethics: Apply ethical principles and commit to professional ethics and
responsibilities andnorms of the engineering practice.
9. Individual and team work: Function effectively as an individual, and as a
member or leaderin diverse teams, and in multidisciplinary settings.
10. Communication: Communicate effectively on complex engineering
activities with theengineering community and with society at large, such as, being
able to comprehend and writeeffective reports and design documentation, make
effective presentations, and give and receiveclear instructions.
11. Project management and finance: Demonstrate knowledge and understanding
of theengineering and management principles and apply these to one’s own work, as
a member andleader in a team, to manage projects and in multidisciplinary
environments.
12.Life-long learning: Recognize the need for, and have the preparation and ability to
engagein independent and life-long learning in the broadest context of technological
change.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

PSO : Program Specific Outcomes

PSO 1- Able to apply the knowledge gained during the course of the program from
Mathematics, Science & Engineering to solve computation task, and ability to
understand, analyze, design and develop computer programs in the areas related to
algorithms, system software, multi-media, web designing, data analytics and networking.
(PO1, PO2, PO3)

PSO 2- Able to comprehend the technological advancements by lifelong learning and usage
of modern tools for analysis and design of application and system software with varying
complexity. (PO4, PO5, PO12)

PSO 3- Able to communicate effectively in oral and written forms with good leadership
quality, team work, managerial skill to work in multi-disciplinary environment, involve in
development of commercially viable projects, demonstrating the practice of professional
ethics for sustainable development of society. (PO6, PO7, PO8, PO9, PO10, PO11)
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

COURSE OUTCOMES

Once the student has successfully completed this course, he/she will be able to:

CO1. Understand the basics of software as a product.

CO2. Understand the current requirements of industries.

CO3. Implement the software as a product using different design patterns.

CO4. Apply the software development techniques in real life applications


Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Prescribed experiment list by University

1. Unit – I Software product life cycle.


2. Unit – II Software product development standards.
3. Unit – III Design patterns – 1
4. Unit -IV Design Patterns – II
5. Unit – V Case Study
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Schedule of Practical List Performed

Batch A Batch B
S. Name of Mappi Type of Catego CO PO PSO Complet Complet Sig
N Experim
ng Exp. ry Mappi Mapping Mappi ion ion n
o. ent
with ng ng
Unit
1 Software I Study Core CO1 1,2,3,4,5,1 PSO 1
product PSO 2
1,12
life cycle.

2 Software II Study Core CO2 1,2,3,4,5,1 PSO 1


product 1,12 PSO 2
developm
ent
standards
.

3 Design Study 1,2,3,4,5,1 PSO 1


patterns – III and Core CO3 1,12 PSO 2
1
Design
4 Design Study Core CO4 1,2,3,4,5,1 PSO 1
patterns – III and 1,12 PSO 2
1I
Design
5 Case IV,V Design Core CO1,2, 1,2,3,4,5,1 PSO 1
Study and 3,4 1,12 PSO 2

Implem
ent
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Experiment No - 1

1. SDLC (Software Development Life Cycle) Phases


Software Development Life Cycle (SDLC) is a framework that defines the steps involved in
the development of software at each phase. It covers the detailed plan for building,
deploying and maintaining the software.SDLC defines the complete cycle of development
i.e. all the tasks involved in planning, testing, and deploying a Software Product.
SDLC is a process which defines the various stages involved in the development of
software for delivering a high-quality product. SDLC stages cover the complete life cycle of
a software i.e. from inception to retirement of the product.
• Requirement gathering
• Analysis
• Design
• Implementation or coding
• Testing
• Deployment
• Maintenance

Phase 1: Requirement gathering:


The requirement is the first stage in the SDLC process. It is conducted by the senior team
members with inputs from all the stakeholders and domain experts in the industry. Planning
for the quality assurance requirements and recognition of the risks involved is also done at
this stage.Requirements Gathering stage need teams to get detailed and precise
requirements. This helps companies to finalize the necessary timeline to finish the work of
that system.

Phase 2: Analysis:
Once the requirement analysis phase is completed the next step is to define and document
software needs. This process was conducted with the help of the 'Software Requirement
Specification' document also known as 'SRS' document. It includes everything which should
be designed and developed during the project life cycle.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Phase 3: Design:

In this phase, the requirement gathered in the SRS document is used as an input and
software architecture that is used for implementing system development is derived.

Phase 4: Implementation or Coding:

Implementation/Coding starts once the developer gets the Design document. The Software
design is translated into source code. All the components of the software are implemented
in this phase.

Phase 5: Testing:

Testing starts once the coding is complete and the modules are released for testing. In this
phase, the developed software is tested thoroughly and any defects found are assigned to
developers to get them fixed.

Phase 6: Deployment:

Once the software testing phase is over and no bugs or errors left in the system then the
final deployment process starts. Based on the feedback given by the project manager, the
final software is released and checked for deployment issues if any.

Phase 7: Maintenance:

After the deployment of a product in the production environment, maintenance of the


product i.e. if any issue comes up and needs to be fixed or any enhancement is done is
taken care by the developers.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

SDLC models:
• Waterfall Model
• RAD Model
• Spiral Model
• V-Model
• Incremental Model
• Iterative Model
• Big Bang Model
• Agile Model
• Prototype Model, etc..

Waterfall Model:
The Waterfall Model was the first Process Model to be introduced. It is also referred to as a
linear-sequential life cycle model. It is very simple to understand and use. In a waterfall
model, each phase must be completed before the next phase can begin and there is no
overlapping in the phases.The Waterfall model is the earliest SDLC approach that was
used for software development. The waterfall Model illustrates the software development
process in a linear sequential flow. This means that any phase in the development process
begins only if the previous phase is complete. In this waterfall model, the phases do not
overlap.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

The Waterfall approach was the first SDLC Model to be used widely in Software
Engineering to ensure success of the project. In "The Waterfall" approach, the whole
process of software development is divided into separate phases. In this Waterfall model,
typically, the outcome of one phase acts as the input for the next phase sequentially. The
following illustration is a representation of the different phases of the Waterfall Model.

The sequential phases in Waterfall model are −


• Requirement Gathering and analysis − All possible requirements of the system to
be developed are captured in this phase and documented in a requirement specification
document.
• System Design − The requirement specifications from first phase are studied in this
phase and the system design is prepared. This system design helps in specifying hardware
and system requirements and helps in defining the overall system architecture.
• Implementation − With inputs from the system design, the system is first developed in
small programs called units, which are integrated in the next phase. Each unit is
developed and tested for its functionality, which is referred to as Unit Testing.
• Integration and Testing − All the units developed in the implementation phase are
integrated into a system after testing each unit. Post integration the entire system is tested
for any faults and failures.
• Deployment − Once the functional and nonfunctional testing is done; the product is
deployed in the customer environment or released into the market.
• Maintenance − There are some issues which come up in the client environment. To fix
those issues, patches are released. Also to enhance the product some better versions are
released. Maintenance is done to deliver these changes in the customer environment.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Waterfall Model - Advantages

The advantages of waterfall development are that it allows for departmentalization and
control. A schedule can be set with deadlines for each stage of development and a product
can proceed through the development process model phases one by one.
• Simple and easy to understand and use
• Easy to manage due to the rigidity of the model. Each phase has specific
deliverables and a review process.
• Phases are processed and completed one at a time.
• Works well for smaller projects where requirements are very well understood.
• Clearly defined stages.
• Easy to arrange tasks.
• Process and results are well documented.

Waterfall Model - Disadvantages

The major disadvantages of the Waterfall Model are as follows −


• No working software is produced until late during the life cycle.
• High amounts of risk and uncertainty.
• Poor model for long and ongoing projects.
• Not suitable for the projects where requirements are at a moderate to high risk of
changing. So, risk and uncertainty is high with this process model.
• It is difficult to measure progress within stages.
• Cannot accommodate changing requirements.

AGILE MODEL:
Agile SDLC model is a combination of iterative and incremental process models with focus on
process adaptability and customer satisfaction by rapid delivery of working software products.
Agile Methods break the product into small incremental builds. These builds are provided in
iterations. Each iteration typically lasts from about one to three weeks.
• Planning
• Requirements Analysis
• Design
• Coding
• Unit Testing and
• Testing.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

At the end of the iteration, a working product is displayed to the customer and clients.
Agile model believes that every project needs to be handled differently and the existing
methods need to be tailored to best suit the project requirements. In Agile, the tasks are divided
into time boxes (small time frames) to deliver specific features for a release.
Iterative approach is taken and working software build is delivered after each iteration. Each
build is incremental in terms of features; the final build holds all the features required by the
customer.

The Agile thought process had started early in the software development and started becoming
popular with time due to its flexibility and adaptability.
Following are the Agile Manifesto principles −
• Individuals and interactions − In Agile development, self-organization and motivation are
important, as are interactions like co-location and pair programming.
• Working software − Demo working software is considered the best means of communication
with the customers to understand their requirements, instead of just depending on
documentation.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

• Customer collaboration − As the requirements cannot be gathered completely in the


beginning of the project due to various factors, continuous customer interaction is very
important to get proper product requirements.
• Responding to change − Agile Development is focused on quick responses to change and
continuous development.

Agile Model - Pros and Cons


Agile methods are being widely accepted in the software world recently. However, this
method may not always be suitable for all products.
The advantages-
• Is a very realistic approach to software development.
• Promotes teamwork and cross training.
• Functionality can be developed rapidly and demonstrated.
• Resource requirements are minimum.
• Suitable for fixed or changing requirements
• Delivers early partial working solutions.
• Good model for environments that change steadily.

The disadvantages-
• Not suitable for handling complex dependencies.
• More risk of sustainability, maintainability and extensibility.
• An overall plan, an agile leader and agile PM practice is a must without which it will
not work.
• Depends heavily on customer interaction, so if the customer is not clear, the team
can be driven in the wrong direction.

Agile Vs Traditional SDLC Models


• Agile is based on the adaptive software development methods, whereas the
traditional SDLC models like the waterfall model is based on a predictive approach.
Predictive teams in the traditional SDLC models usually work with detailed planning
and have a complete forecast of the exact tasks and features to be delivered in the
next few months or during the product life cycle.
• Predictive methods entirely depend on the requirement analysis and planning done
in the beginning of cycle. Any changes to be incorporated go through a strict change
control management and prioritization.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

• Agile uses an adaptive approach where there is no detailed planning and there is
clarity on future tasks only in respect of what features need to be developed. There
is feature driven development and the team adapts to the changing product
requirements dynamically. The product is tested very frequently, through the release
iterations, minimizing the risk of any major failures in future.
• Customer Interaction is the backbone of this Agile methodology, and open
communication with minimum documentation are the typical features of Agile
development environment. The agile teams work in close collaboration with each
other and are most often located in the same geographical location.

Experiment No - 2

2. Software Product Development Standards.

Software quality management

The quality of software has improved significantly over the past two decades. One
reason for this is that companies have used new technologies in their software
development process such as object-oriented development, CASE tools, etc. In
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

addition, a growing importance of software quality management and the adoption of


quality management techniques from manufacturing can be observed. However,
software quality significantly differs from the concept of quality generally used in
manufacturing mainly for the next reasons.

1. The software specification should reflect the characteristics of the product that
the customer wants. However, the development organization may also have
requirements such as maintainability that are not included in the specification.
2. Certain software quality attributes such as maintainability, usability, reliability
cannot be exactly specified and measured.

3. At the early stages of software process it is very difficult to define a complete


software specification. Therefore, although software may conform to its
specification, users don’t meet their quality expectations.

Software quality management is split into three main activities:

1. Quality assurance. The development of a framework of organizational


procedures and standards that lead to high quality software.
2. Quality planning. The selection of appropriate procedures and standards from
this framework and adapt for a specific software project.

3. Quality control. Definition of processes ensuring that software development


follows the quality procedures and standards.

Quality management provides an independent check on the software and software


development process. It ensures that project deliverables are consistent with
organizational standards and goals.

Process and product quality

It is general, that the quality of the development process directly affects the quality of
delivered products. The quality of the product can be measured and the process is
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

improved until the proper quality level is achieved. Figure illustrates the process of
quality assessment based on this approach.

In manufacturing systems there is a clear relationship between production process and


product quality. However, quality of software is highly influenced by the experience of
software engineers. In addition, it is difficult to measure software quality attributes,
such as maintainability, reliability, usability, etc., and to tell how process
characteristics influence these attributes. However, experience has shown that process
quality has a significant influence on the quality of the software.

Process quality management includes the following activities:

1. Defining process standards.


2. Monitoring the development process.

3. Reporting the software.

Quality assurance and standards

Quality assurance is the process of defining how software quality can be achieved and
how the development organization knows that the software has the required level of
quality. The main activity of the quality assurance process is the selection and
definition of standards that are applied to the software development process or
software product. There are two main types of standards. The product standards are
applied to the software product, i.e. output of the software process. The process
standards define the processes that should be followed during software development.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

The software standards are based on best practices and they provide a framework for
implementing the quality assurance process.

The development of software engineering project standards is a difficult and time


consuming process. National and international bodies such as ANSI and the IEEE
develop standards that can be applied to software development projects.
Organizational standards, developed by quality assurance teams, should be based on
these national and international standards. Table shows examples of product and
process standards.

Examples of product and process standards.

Product standards Process standards


Requirements document structure Project plan approval process
Method header format Version release process
Java programming style Change control process
Change request form Test recording process

ISO Standard

ISO 9000 is an international set of standards that can be used in the development of a
quality management system in all industries. ISO 9000 standards can be applied to a
range of organizations from manufacturing to service industries. ISO 9001 is the most
general of these standards. It can be applied to organizations that design, develop and
maintain products and develop their own quality processes. A supporting document
(ISO 9000-3) interprets ISO 9001 for software development.

The ISO 9001 standard isn’t specific to software development but includes general
principles that can be applied to software development projects. The ISO 9001
standard describes various aspects of the quality process and defines the organizational
standards and procedures that a company should define and follow during product
development. These standards and procedures are documented in an organizational
quality manual.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

The ISO 9001 standard does not define the quality processes that should be used in the
development process. Organizations can develop own quality processes and they can
still be ISO 9000 compliant companies. The ISO 9000 standard only requires the
definition of processes to be used in a company and it is not concerned with ensuring
that these processes provide best practices and high quality of products. Therefore, the
ISO 9000 certification doesn’t means exactly that the quality of the software produced
by an ISO 9000 certified companies will be better than that software from an
uncertified company.

Documentation standards

Documentation standards in a software project are important because documents can


represent the software and the software process. Standardized documents have a
consistent appearance, structure and quality, and should therefore be easier to read and
understand. There are three types of documentation standards:

1. Documentation process standards. These standards define the process that


should be followed for document production.
2. Document standards. These standards describe the structure and presentation
of documents.

3. Documents interchange standards. These standards ensure that all electronic


copies of documents are compatible.

Quality planning

Quality planning is the process of developing a quality plan for a project. The quality
plan defines the quality requirements of software and describes how these are to be
assessed. The quality plan selects those organizational standards that are appropriate to
a particular product and development process. Quality plan has the following parts:

1. Introduction of product.
2. Product plans.

3. Process descriptions.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

4. Quality goals.

5. Risks and risk management.

The quality plan defines the most important quality attributes for the software and
includes a definition of the quality assessment process. Table shows generally used
software quality attributes that can be considered during the quality planning process.

Software quality attributes.

Safety Understandability Portability


Security Testability Usability
Reliability Adaptability Reusability
Resilience Modularity Efficiency
Robustness Complexity Learnability
Maintainability    

Quality control
Quality control provides monitoring the software development process to ensure that
quality assurance procedures and standards are being followed. The deliverables
from the software development process are checked against the defined project
standards in the quality control process. The quality of software project deliverables
can be checked by regular quality reviews and/or automated software assessment.
Quality reviews are performed by a group of people. They review the software and
software process in order to check that the project standards have been followed and
that software and documents conform to these standards. Automated software
assessment processes the software by a program that compares it to the standards
applied to the development project.

Quality reviews

Quality reviews are the most widely used method of validating the quality of a
process or product. They involve a group of people examining part or all of a software
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

process, system, or its associated documentation to discover potential problems. The


conclusions of the review are formally recorded and passed to the author for
correcting the discovered problems. Table 12.3. describes several types of review,
including quality reviews.

Types of review.

Review type Principal purpose


Design or
program To detect detailed errors in the requirements, design or code.
inspections
Progress To provide information for management about the overall progress of
reviews the project.
To carry out a technical analysis of product components or
documentation to find mismatches between the specification and the
Quality reviews
component design, code or documentation and to ensure that defined
quality standards of the organization have been followed.

Software measurement and metrics

Software measurement provides a numeric value for some quality attribute of a


software product or a software process. Comparison of these numerical values to each
other or to standards draws conclusions about the quality of software or software
processes. Software product measurements can be used to make general predictions
about a software system and identify anomalous software components.

Software metric is a measurement that relates to any quality attributes of the software
system or process. It is often impossible to measure the external software quality
attributes, such as maintainability, understandability, etc., directly. In such cases, the
external attribute is related to some internal attribute assuming a relationship between
them and the internal attribute is measured to predict the external software
characteristic. Three conditions must be hold in this case:
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

1. The internal attribute must be measured accurately.


2. A relationship must exist between what we can measure and the external
behavioural attribute.

3. This relationship has to be well understood, has been validated and can be
expressed in terms of a mathematical formula.

The measurement process

A software measurement process as a part of the quality control process is shown in


Figure The steps of measurement process are the followings:

1. Select measurements to be made. Selection of measurements that are relevant to


answer the questions to quality assessment.
2. Select components to be assessed. Selection of software components to be
measured.

3. Measure component characteristics. The selected components are measured and


the associated software metric values computed.

4. Identify anomalous measurements. If any metric exhibit high or low values it


means that component has problems.

5. Analyze anomalous components. If anomalous values for particular metrics


have been identified these components have to be examined to decide whether
the anomalous metric values mean that the quality of the component is
compromised.

Generally each of the components of the system is analyzed separately. Anomalous


measurements identify components that may have quality problems.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Product metrics

The software characteristics that can be easily measured such as size do not have a
clear and consistent relationship with quality attributes such as understandability and
maintainability. Product metrics has two classes:

1. Dynamic metrics. These metrics (for example execution time) are measured
during the execution of a program.
2. Static metrics. Static metrics are based on measurements made of
representations of the system such as the design, program or documentation.

Dynamic metrics can be related to the efficiency and the reliability of a program. Static
metrics such as code size are related to software quality attributes such as complexity,
understandability, maintainability, etc.

Experiment No - 3

Design Patterns-I
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

In software engineering, a design pattern is a general repeatable solution to a commonly


occurring problem in software design. A design pattern isn't a finished design that can be
transformed directly into code. It is a description or template for how to solve a problem that can be
used in many different situations.

Uses of Design Patterns

Design patterns can speed up the development process by providing tested, proven
development paradigms. Effective software design requires considering issues that may not
become visible until later in the implementation. Reusing design patterns helps to prevent
subtle issues that can cause major problems and improves code readability for coders and
architects familiar with the patterns.

Often, people only understand how to apply certain software design techniques to certain
problems. These techniques are difficult to apply to a broader range of problems. Design
patterns provide general solutions, documented in a format that doesn't require specifics
tied to a particular problem.

In addition, patterns allow developers to communicate using well-known, well understood


names for software interactions. Common design patterns can be improved over time,
making them more robust than ad-hoc designs.

Creational design patterns


hese design patterns are all about class instantiation. This pattern can be further divided into class-
creation patterns and object-creational patterns. While class-creation patterns use inheritance
effectively in the instantiation process, object-creation patterns use delegation effectively to get the
job done.

 AbstractFactory
Creates an instance of several families of classes
 Builder
Separates object construction from its representation

 FactoryMethod
Creates an instance of several derived classes

 ObjectPool
Avoid expensive acquisition and release of resources by recycling objects that are no
longer in use

 Prototype
A fully initialized instance to be copied or cloned
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

 Singleton
A class of which only a single instance can exist

Structural design patterns


These design patterns are all about Class and Object composition. Structural class-creation patterns
use inheritance to compose interfaces. Structural object-patterns define ways to compose objects to
obtain new functionality.

 Adapter
Match interfaces of different classes
 Bridge
Separates an object’s interface from its implementation

 Composite
A tree structure of simple and composite objects

 Decorator
Add responsibilities to objects dynamically

 Facade
A single class that represents an entire subsystem

 Flyweight
A fine-grained instance used for efficient sharing

 Private Class data

Restricts accessor/mutator access

 Proxy
An object representing another object

Behavioral design patterns


These design patterns are all about Class's objects communication. Behavioral patterns are those
patterns that are most specifically concerned with communication between objects.

 Chainofresponsibility
A way of passing a request between a chain of objects
 Command
Encapsulate a command request as an object

 Interpreter
A way to include language elements in a program
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

 Iterator
Sequentially access the elements of a collection

 Mediator
Defines simplified communication between classes

 Memento
Capture and restore an object's internal state

 NullObject
Designed to act as a default value of an object

 Observer
A way of notifying change to a number of classes

 State
Alter an object's behavior when its state changes

 Strategy
Encapsulates an algorithm inside a class

 Templatemethod
Defer the exact steps of an algorithm to a subclass

 Visitor
Defines a new operation to a class without change
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Experiment N0 – 4

Design Pattern – II

Abstract Factory Pattern

Introduction
Abstract Factory design pattern is one of the Creational pattern. Abstract Factory
pattern is almost similar to Factory Pattern is considered as another layer of abstraction
over factory pattern. Abstract Factory patterns work around a super-factory which
creates other factories.
Abstract factory pattern implementation provides us a framework that allows us to
create objects that follow a general pattern. So at runtime, abstract factory is coupled
with any desired concrete factory which can create objects of desired type.

UML class diagram example for the Abstract Factory Design Pattern.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

 AbstractFactory : Declares an interface for operations that create abstract


product objects.
 ConcreteFactory : Implements the operations declared in the AbstractFactory
to create concrete product objects.
 Product : Defines a product object to be created by the corresponding concrete
factory and implements the AbstractProduct interface.
 Client : Uses only interfaces declared by AbstractFactory and AbstractProduct
classes.
Abstract Factory provides interfaces for creating families of related or dependent
objects without specifying their concrete classes.
Client software creates a concrete implementation of the abstract factory and then uses
the generic interfaces to create the concrete objects that are part of the family of
objects.
The client does not know or care which concrete objects it gets from each of these
concrete factories since it uses only the generic interfaces of their products.
So with this idea of Abstract Factory pattern, we will now try to create a design that
will facilitate the creation of related objects.
Implementation
Let’s take an example, Suppose we want to build a global car factory. If it was factory
design pattern, then it was suitable for a single location. But for this pattern, we need
multiple locations and some critical design changes.
We need car factories in each location like IndiaCarFactory, USACarFactory and
DefaultCarFactory. Now, our application should be smart enough to identify the
location where it is being used, so we should be able to use appropriate car factory
without even knowing which car factory implementation will be used internally. This
also saves us from someone calling wrong factory for a particular location.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Experiment -5
Case Study

Develop Class diagram

Objective:-
To show diagrammatically the objects required and the relationships between them while developing
a software product.

Software Required :-

Visual Paradigm for UML 8.2

Procedure :-

Step 1:-
Right click Class Diagram on Diagram Navigator and select New Class Diagram from the pop-up menu to
create a class diagram.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Step 2:-

Creating class
To create class, click Class on the diagram toolbar and then click on the diagram.

A class will be created.

Creating association
To create association from class, click the Association -> Class resource beside it and drag.

Drag to empty space of the diagram to create a new class, or drag to an existing class to connect to it. Release
the mouse button to create the association.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

To create aggregation, use the Aggregation -> Class resource instead.

Step 3:-

To edit multiplicity of an association end, right-click near the association end, select Multiplicityfrom the
popup menu and then select a multiplicity.

To show the direction of an association, right click on it and select Presentation Options > Show


Direction from the pop-up menu.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Step 4:-

The direction arrow is shown beside the association.

Creating generalization
To create generalization from class, click the Generalization -> Class resource beside it and drag.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Drag to empty space of the diagram to create a new class, or drag to an existing class to connect to it. Release
the mouse button to create the generalization.

Creating attribute
To create attribute, right click the class and select Add > Attribute from the pop-up menu.

An attribute is created.

Creating attribute with enter key


After creating an attribute, press the Enter key, another attribute will be created. This method lets you create
multiple attributes quickly and easily.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Creating operation
To create operation, right click the class and select Add > Operation from the pop-up menu.

An operation is created.

Similar to creating attribute, you can press the Enter key to create multiple operations continuously.
Drag-and-Drop reordering, copying and moving of class members
To reorder a class member, select it and drag within the compartment, you will see a thick black line appears
indicating where the class member will be placed.

Release the mouse button, the class member will be reordered.


Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

To copy a class member, select it and drag to the target class while keep pressing the Ctrl key, you will see a
thick black line appears indicating where the class member will be placed. A plus sign is shown beside the
mouse cursor indicating this is a copy action.

Release the mouse button, the class member will be copied.

To move a class member, select it and drag to the target class, you will see a thick black line appears
indicating where the class member will be placed. Unlike copy, do not press the Ctrl key when drag, the
mouse cursor without the plus sign indicates this is a move action.

Release the mouse button, the class member will be moved.

Model name completion for class


The model name completion feature enables quick creation of multiple views for the same class model. When
create or rename class, the list of classes is shown.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Type text to filter classes in the list.

Press up or down key to select class in the list, press Enter to confirm. Upon selecting an existing class, all
class members and relationships are shown immediately.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Step 5:-

Continue to complete the diagram.

Generalization set
A generalization set defines a particular set of generalization relationships that describe the way
in which a general classifier (or superclass) may be divided using specific subtypes. To define a generalization
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

set, select the generalizations to include, right click and select Generalization set > Create Generalization Set...
from the popup menu.

Step 6:-
Name the set in the Manage Generalization Sets dialog box, and confirm by pressing OK.
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

The selected generalizations are grouped. Adjust the connector to make the diagram tidy .
Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

Repeat the steps for other generalizations.


Gyan Ganga Institute of Technology and Sciences, Jabalpur
Computer Science & Engineering

You might also like