Software Engineering · Unit 8
Design Patterns and Modeling
Exam-focused notes for Design Patterns and Modeling (Software Engineering, BIT302): what the TU syllabus asks and how it has actually been tested, with 4 solved past questions from this unit.
Design Patterns and Modeling in short
This chapter covers reusable design solutions (patterns), the models used to estimate software cost, and two common kinds of system: transaction processing and language processing.
What this unit covers
- Design patterns and their benefits
- Algorithmic cost modeling
- COCOMO estimation models
- Transaction processing systems
- Language processing systems
Design patterns and their benefits
2082 · 5 marks
How do you think design patterns help in software development? Explain. [5]
Algorithmic cost modeling
2080 · 10 marks
What do you understand by algorithmic cost modeling? Explain COCOMO estimation models.[10]
Transaction processing systems
2079 · 5 marks
Explain transaction procession system and language processing system. [5]
COCOMO estimation models
0 · 5 marks
Write short notes on: a. COCOMO b. Design Pattern [5]
Show solved answerHide answer
Short Notes
a. COCOMO (Constructive Cost Model)
COCOMO is an algorithmic software cost estimation model developed by Barry Boehm in 1981. It is used to estimate the effort, time, and cost required to develop a software project based on the size of the software (measured in KLOC - Kilo Lines of Code).
Types of COCOMO:
1. Basic COCOMO
- Provides a rough estimate of software development effort.
- Formula:
Effort (E) = a × (KLOC)^b (Person-Months) Time (T) = c × (E)^d (Months)
2. Intermediate COCOMO
- Refines the basic model by introducing cost driver attributes (hardware, personnel, project attributes).
- More accurate than basic COCOMO.
3. Detailed COCOMO
- Applies cost drivers at each phase of the software development lifecycle.
- Most accurate among the three.
Project Categories:
| Mode | Description | Example |
|---|---|---|
| Organic | Small, simple projects | Payroll system |
| Semi-detached | Medium complexity | Compiler design |
| Embedded | Complex, tight constraints | Real-time systems |
Advantages:
- Easy to use and understand
- Provides quantitative estimates
Limitations:
- Based only on KLOC (does not consider modern development methods)
- Not suitable for agile or object-oriented projects
b. Design Pattern
A Design Pattern is a general, reusable solution to a commonly occurring problem in software design. It is not a finished design but a template or description of how to solve a problem that can be used in many different situations.
The concept was popularized by the "Gang of Four" (GoF) - Gamma, Helm, Johnson, and Vlissides in their book "Design Patterns: Elements of Reusable Object-Oriented Software" (1994).
Types of Design Patterns:
1. Creational Patterns
- Deal with object creation mechanisms.
- Examples: Singleton, Factory, Abstract Factory, Builder, Prototype
2. Structural Patterns
- Deal with object composition and structure.
- Examples: Adapter, Bridge, Composite, Decorator, Facade
3. Behavioral Patterns
- Deal with communication and responsibility between objects.
- Examples: Observer, Strategy, Command, Iterator, Template Method
Benefits of Design Patterns:
- Promotes code reusability and maintainability
- Provides a common vocabulary for developers
- Speeds up the development process
- Helps in writing flexible and scalable code
Example - Singleton Pattern:
Ensures that a class has only one instance and provides a global point of access to it.
class Singleton {
private static Singleton instance;
private Singleton() {}
public static Singleton getInstance() {
if (instance == null)
instance = new Singleton();
return instance;
}
}
Make Unit 8 stick
Practice BIT302 with flashcards & quizzes