Extends
Overview
What is Extends?
Inheritance: The Underlying Concept
Conceptual Example
Basic Syntax
Single Inheritance
Example: Person → Employee → Engineer
Multiple Inheritance
Example: Multiple Base Classes
Versioning
Version Syntax
Example
Override="1"
Critical Rules
Override at Extends Level (Selective Override)
Syntax
Example
Multiple Parameter Override
Override Named Object (Complete Replacement)
Syntax
Example
How to Override Parameters at Top Level
Wrong Approach
Correct Approach
Override Summary Table
Override Location
Syntax
Must Redefine All?
Use Case
Quick Decision Guide
Scoped="1"
Rules
Top Level (No Scoped)
Inside Objects (Use Scoped)
Without Scoped (Top Level)
With Scoped (Inside Object)
When to Extend at Top vs Group Level
Top Level (T="Project"): True Inheritance (IS-A)
Type Compatibility Through Base Classes
Group Level (T="Group"): Reusing Logic (HAS-A)
Decision Guide
Scenario
Use
Example
Transitive Inheritance
Example
With Overrides
Type Inheritance
Type Chain
Why This Matters
Extending Objects Inside Other Objects
Example: Extending Inside Volume
Common Patterns
Pattern 1: Base Class with Specializations
Pattern 2: Reusing Calculation Logic
Pattern 3: Selective Parameter Override
Pattern 4: Multiple Base Classes for Modularity
Pattern 5: Version-Specific Extensions
Extends vs Instances
Feature
Extends (Inheritance)
T="..." (Instances)
Extends (Inheritance)
Instances (T="...")
Cannot Combine
Best Practices
1. Avoid Parameter Name Conflicts
2. Use Scoped="1" Consistently
3. Use Versioning for Stability
4. Choose Override Strategy Wisely
5. Group Parameters for Overriding
6. Document Inheritance Chains
7. Choose Inheritance Level Wisely
8. Keep Inheritance Hierarchies Shallow
9. Remember Override Rules
Common Mistakes
❌ Mistake 1: Missing T Attribute
❌ Mistake 2: Trying to Override Parameters Directly
❌ Mistake 3: Forgetting to Redefine All When Overriding Object
❌ Mistake 4: Missing Scoped="1" Inside Objects
❌ Mistake 5: Combining Extends and Instance Creation
Summary
Key Concepts
Concept
Description
Override Rules (Critical!)
Override Type
Syntax
Redefine All?
Use When
When to Use
Use Case
Syntax
Example
Rules to Remember
Last updated