CSCI 370 - Lecture 11 Review Sheet - Software Requirements, Design Principles, Development Models, UML Diagrams, and Design Patterns
This lecture primarily focused on reviewing a midterm exam and elaborating on important concepts in software engineering. Below is a detailed breakdown of the key points discussed, with elaborations where necessary.
๐ Functional vs. Non-Functional Requirements
- Functional Requirements: Specific behaviors or functions a system must perform, based on client requests (e.g., โThe system shall allow users to log inโ).
- Non-Functional Requirements: Constraints or qualities the system must have, not tied to specific functions (e.g., performance, scalability, usability). Often span multiple features.
โ๏ธ Benefits of Using Cloud Software
- No need for maintenance by the user
- Available anywhere with internet
- Scalable with demand
- Often cost-effective
- Answer: All of the above
๐งฑ Strategy Pattern
- Replaces inheritance with composition.
- Promotes flexible and interchangeable behavior by encapsulating algorithms.
- Answer: Composition
๐งผ Code Quality - DRY Principle
- DRY: Donโt Repeat Yourself
- Violating DRY leads to code duplication and harder maintenance.
- Identified example: Repeating the same logic in multiple places.
๐งฉ Relationships Between Classes
Example: MedicalRecord and Database
- Composition: MedicalRecord has a Database
- Encapsulation: Not achieved if Database is public
- Dependency: MedicalRecord is dependent on Database if it wonโt compile without it
- Correct analysis:
- Composition: โ
- Encapsulation: โ (Database is public)
- Dependency: โ
๐ Incremental Development
- Involves building software in small, manageable increments
- Examples: Agile, Scrum, Extreme Programming
- Not Incremental: Reuse model (or Waterfall in certain contexts)
๐ Design Principle - Open/Closed Principle
- Open for extension, closed for modification: You should be able to add new functionality without changing existing code.
- Used in several design patterns (e.g., Strategy, Observer)
โ ๏ธ Software Engineering Challenges
- Managing complexity
- Meeting customer requirements
- Maintaining software
- Coping with change
- Answer: All of the above
๐ต๏ธ Observer Pattern
- Allows objects to be notified when another objectโs state changes
- Useful when adding new types (e.g., new banks in the example)
- Avoids hardcoded logic for each dependent object
โ๏ธ Singleton Pattern
- Ensures a class has only one instance
- Provides a global access point
- Lazily initialized and thread-safe if done correctly
- Answer: All of the above
๐ Incremental Development: True/False
- Customer involvement: โ True
- All requirements fixed before coding: โ False
- Easy to modify: โ True
- No need for refactoring: โ False
- Only unit testing: โ False (also includes integration/system testing)
โ๏ธ Missing Step in Process
- Steps: Specification, Development, Testing
- Answer: Testing
๐ฐ Waterfall Model Use Cases
- Used when changes are expensive or high risk
- Suitable for:
- Medical software (FDA approval required)
- Airplane software (FAA certification required)
- Refrigerator software (deployed with hardware)
- Not suitable for: Game software (frequent updates, low risk)
๐ Process Order
- Feasibility (Can we do it?)
- Requirements
- Design
- Development
- Testing
- Deployment & Maintenance (follow afterward)
๐ Reusable Software
- Any software type can be reused in other projects
- Encourages modular, component-based design
๐ผ UML Diagrams
- Triangle arrow (inheritance): One class is a subtype of another
- Line (association): Indicates one class uses another
๐งฐ Best Design Practice
- Prefer composition over inheritance
- Avoid overly generic types (e.g.,
Object
) - Design for maintainability and scalability
๐งโ๐ผ Maintainability in High Turnover Environments
- Critical when team members frequently join/leave
- Knowledge about the codebase is easily lost
- Maintainable code is easier for new developers to understand
๐ Degree Requirement
- No formal degree is required to become a software engineer
- Skill, experience, and projects often matter more than credentials
๐ผ Software Project Scope
- Includes:
- Hardware considerations
- Finances
- Management
- Scheduling
- Software projects are multifaceted
๐ Process Not Required in Software Discovery
- Reuse model is optional
- Others (e.g., waterfall, agile, spiral) are standard models
๐งช Summary of Design Patterns Mentioned
- Observer: Dynamic dependencies
- Singleton: One instance only
- Strategy: Replace inheritance with composition
- State: Not yet covered in lecture
โ Key Takeaways
- Understand difference between functional and non-functional requirements
- Know when to use Waterfall vs. Incremental
- Learn design principles: DRY, Open/Closed, Encapsulation, Composition over Inheritance
- Understand and recognize common design patterns
- Maintainability and team dynamics influence architectural decisions
- Be familiar with UML basics: association vs. inheritance
- Process steps and development models guide lifecycle planning