1.
Introduction to UML and Unified Process
Questions
1. Define UML and explain its various diagrams.
2. What is the Unified Process? Describe its phases with examples.
3. Compare traditional SDLC and RUP.
Answers
1. UML and Diagrams: UML (Unified Modeling Language) is a standard for
visualizing software systems. Key diagrams:
o Structural: Class, Object, Component, Deployment.
o Behavioral: Use Case, Sequence, State, Activity.
o Interaction: Communication, Interaction Overview.
2. Unified Process Phases:
o Inception: Feasibility study, use case modeling.
o Elaboration: Requirements and architecture definition.
o Construction: Development and testing.
o Transition: Deployment to production.
3. RUP vs Traditional SDLC:
o Iterative Development in RUP allows for refinement, unlike the rigid linear
structure of SDLC.
o Focus on Models: RUP uses UML extensively.
2. Software Architecture
Questions
1. Define software architecture and its importance.
2. Explain the 4+1 view model of software architecture.
3. Discuss the role of architectural structures and views.
Answers
1. Definition: Software architecture is the design of the system's structure and its
interactions. Importance: Ensures scalability, maintainability, and clarity.
2. 4+1 View Model:
o Logical View: Functional aspects.
o Development View: Organization of code.
o Process View: Runtime processes.
o Physical View: Deployment.
o Scenarios: Link all views with use cases.
3. Architectural Structures and Views:
o Logical (business logic), Physical (deployment), Development (coding
organization), Process (execution flow).
3. Architectural Styles
Questions
1. What are architectural styles? Explain with examples.
2. Describe the pipes-and-filters style.
3. Explain the layered architecture with examples.
4. What are heterogeneous architectures?
Answers
1. Architectural Styles:
o Predefined design templates.
o Examples: Pipes-and-filters, layered, and client-server.
2. Pipes-and-Filters:
o Components (filters) process data passed through pipelines.
o Example: UNIX shell commands.
3. Layered Architecture:
o Layers: Presentation, Business, Data.
o Example: MVC architecture.
4. Heterogeneous Architecture:
o Combines multiple styles for complex systems. Example: Combining layered
and event-driven models.
4. Introduction to Patterns
Questions
1. What are design patterns? Explain their importance.
2. Describe the components of a design pattern.
3. Differentiate between creational, structural, and behavioral patterns.
Answers
1. Design Patterns: Reusable solutions to software design problems. Importance:
Increases modularity and readability.
2. Components:
o Name, Problem, Solution, Consequences.
3. Pattern Categories:
o Creational: Focus on object creation (e.g., Singleton).
o Structural: Manage relationships (e.g., Adapter).
o Behavioral: Communication between objects (e.g., Observer).
5. Study of Design Patterns
Questions
1. Explain the Singleton pattern with an example.
2. What is the Factory Method pattern?
3. Describe the Observer pattern and its applications.
Answers
1. Singleton Pattern: Restricts instantiation to a single object. Example: Database
connection manager.
java
Copy code
public class Singleton {
private static Singleton instance;
private Singleton() {}
public static Singleton getInstance() {
if (instance == null) instance = new Singleton();
return instance;
}
}
2. Factory Method:
o Creates objects without specifying exact classes.
o Example: Abstract vehicle factory producing car/bike.
3. Observer Pattern:
o Used for one-to-many dependency updates.
o Example: Notification system for subscribers.
6. GRASP Patterns
Questions
1. What is the Creator pattern in GRASP? Provide an example.
2. Explain High Cohesion and Low Coupling.
3. Describe Polymorphism and its advantages in design.
Answers
1. Creator Pattern:
o Responsibility assigned to the class that aggregates or uses another.
o Example: Order object creating Product objects.
2. High Cohesion and Low Coupling:
o Cohesion: Responsibility focus.
o Coupling: Dependency minimization.
3. Polymorphism:
o Allows method overriding.
o Example: Shape class with draw() method overridden in Circle/Rectangle.
7. Frameworks
Questions
1. What are the advantages of using frameworks?
2. Explain the Spring Framework and its features.
3. What is Spring Boot? How does it simplify development?
Answers
1. Framework Advantages:
o Reusability, faster development, modularity.
2. Spring Framework:
o Features: Dependency injection, AOP, JDBC support.
3. Spring Boot:
o Simplifies Spring setup with embedded servers and autoconfiguration.
8. Case Study
Questions
1. How can patterns be identified in frameworks?
2. Discuss the benefits of patterns in the Spring Framework.
Answers
1. Identifying Patterns:
o Singleton for bean management, Factory Method for object creation, etc.
2. Benefits in Spring:
o Modularity, scalability, better dependency management.
1. Introduction to UML and Unified Process
1.1 UML and Its Notation
Definition: UML (Unified Modeling Language) is a standard way to visualize system
designs.
Diagrams in UML:
o Structural: Class, Object, Component, Deployment.
o Behavioral: Use Case, Sequence, State, Activity.
o Interaction: Communication, Timing, Interaction Overview.
1.2 Unified Process (UP)
Definition: UP is an iterative software development methodology.
Phases:
o Inception: Identify project scope and risks.
o Elaboration: Define architecture and refine requirements.
o Construction: Develop and test the software.
o Transition: Deliver the product and provide support.
1.3 Artifacts in Each Phase
Inception: Vision document, use case model.
Elaboration: Software architecture document.
Construction: Source code, test cases.
Transition: User manuals, release notes.
2. Software Architecture
2.1 Definition of Software Architecture
Definition: The structure of a system, including its components and their interactions.
Examples:
o Client-server architecture.
o Microservices architecture.
2.2 Importance of Software Architecture
Provides scalability.
Ensures maintainability.
Facilitates communication among stakeholders.
2.3 Architectural Structures and Views
Logical: Describes functional components.
Development: Organizes code.
Physical: Represents deployment on hardware.
Process: Focuses on runtime processes.
3. Architectural Styles
3.1 Common Architectural Styles
1. Pipes-and-Filters:
o Data passes through components (filters) connected by pipelines.
o Example: UNIX shell commands.
2. Layered Systems:
o Divided into layers (e.g., Presentation, Business Logic, Data).
o Example: MVC (Model-View-Controller).
3. Repository:
o Centralized storage accessed by various components.
o Example: Database systems.
4. Interpreter:
o Executes instructions dynamically.
o Example: Virtual machines.
4. Design Patterns
4.1 What are Patterns?
Definition: Reusable solutions for recurring design problems.
Components:
o Name: Identifies the pattern.
o Problem: Explains when to use it.
o Solution: Details the design.
o Consequences: Analyzes trade-offs.
4.2 Types of Patterns
1. Creational:
o Focus: Object creation.
o Examples: Singleton, Factory Method.
2. Structural:
o Focus: Class relationships.
o Examples: Adapter, Decorator, Façade.
3. Behavioral:
o Focus: Communication between objects.
o Examples: Observer, Strategy, Command.
5. Study of Design Patterns
Singleton Pattern
Restricts object creation to one instance.
Code Example (Java):
java
Copy code
public class Singleton {
private static Singleton instance;
private Singleton() {}
public static Singleton getInstance() {
if (instance == null) instance = new Singleton();
return instance;
}
}
Factory Method
Creates objects without specifying exact classes.
Example: Vehicle factory producing Car or Bike objects.
Observer Pattern
Defines one-to-many dependency.
Example: News subscription system.
6. GRASP (General Responsibility Assignment Software Patterns)
Core Patterns
1. Expert:
o Assign responsibility to the class with the required knowledge.
o Example: Order class managing Product instances.
2. High Cohesion:
o Ensures a class focuses on a single responsibility.
3. Low Coupling:
o Minimizes dependencies between classes.
7. Frameworks
7.1 Spring Framework
Core Features:
o Dependency Injection.
o Aspect-Oriented Programming (AOP).
o JDBC Support.
7.2 Spring Boot
Simplifies Spring setup with embedded servers.
Advantages:
o Auto-configuration.
o Standalone applications.
7.3 Framework Lifecycle
1. Initialization: Define components.
2. Execution: Framework provides runtime support.
3. Termination: Clean up resources.
8. Case Study
Identify Patterns in Frameworks:
o Singleton: Spring beans.
o Factory: Bean creation in Spring.
Benefits:
o Increased modularity and maintainability.
Important Notes for Exam
UML Diagrams:
Memorize use cases, class, and sequence diagrams.
Architectural Styles:
Focus on Layered and Pipes-and-Filters styles.
Design Patterns:
Understand Singleton, Factory, Observer with examples.
Frameworks:
Focus on Spring and Spring Boot features.
GRASP Patterns:
High Cohesion and Low Coupling are crucial concepts.