0
0
LLDsystem_design~25 mins

Identifying classes from requirements in LLD - System Design Exercise

Choose your learning style9 modes available
Design: Class Identification from Requirements
Focus on identifying classes, their attributes, methods, and relationships from textual requirements. Out of scope: detailed implementation or database design.
Functional Requirements
FR1: Analyze given software requirements to find key entities.
FR2: Determine attributes and behaviors for each entity.
FR3: Establish relationships between entities.
FR4: Create a clear class diagram representing the system structure.
Non-Functional Requirements
NFR1: Classes must represent real-world concepts or system components.
NFR2: Relationships must be accurate (inheritance, association, aggregation, composition).
NFR3: Design should be simple and understandable for beginners.
NFR4: Support scalability for future system expansion.
Think Before You Design
Questions to Ask
❓ Question 1
❓ Question 2
❓ Question 3
❓ Question 4
❓ Question 5
Key Components
Entities as classes
Attributes as class properties
Methods as class behaviors
Relationships like inheritance and associations
Design Patterns
Single Responsibility Principle
Encapsulation
Inheritance and Polymorphism
Association, Aggregation, Composition
Reference Architecture
Requirements Text
      |
      v
  Identify Nouns (Entities) ---> Define Classes
      |                             |
      v                             v
  Identify Verbs (Behaviors)    Define Attributes
      |                             |
      v                             v
  Establish Relationships <-------
      |
      v
  Draw Class Diagram
Components
Class
UML/OO Design
Represents an entity with attributes and behaviors.
Attribute
UML/OO Design
Describes properties or data held by a class.
Method
UML/OO Design
Defines actions or behaviors of a class.
Relationship
UML/OO Design
Shows how classes connect (inheritance, association, etc.).
Request Flow
1. Read the software requirements text.
2. Extract nouns to identify potential classes.
3. Extract verbs to identify methods or behaviors.
4. Determine attributes from descriptive phrases.
5. Analyze relationships between classes (e.g., 'is a', 'has a').
6. Create a class diagram showing classes, attributes, methods, and relationships.
Database Schema
Not applicable; focus is on class identification and relationships, not database design.
Scaling Discussion
Bottlenecks
Complex requirements with many entities can cause confusion.
Ambiguous or incomplete requirements lead to incorrect class identification.
Overlapping responsibilities among classes reduce clarity.
Ignoring relationships can cause poor system structure.
Solutions
Break down requirements into smaller parts and analyze separately.
Clarify ambiguous requirements with stakeholders.
Apply design principles like Single Responsibility Principle.
Use iterative refinement and peer reviews of class diagrams.
Interview Tips
Time: Spend 10 minutes understanding requirements and identifying nouns and verbs, 15 minutes defining classes and relationships, and 5 minutes reviewing and explaining the class diagram.
Explain how you identify classes from nouns in requirements.
Describe how verbs help define class behaviors (methods).
Discuss how you determine relationships between classes.
Mention design principles used to keep classes focused and maintainable.
Highlight importance of iterative refinement and communication.