Open mtabbasi opened 6 days ago
Thanks for posting the issue, @mtabbasi. If I understand correctly, you are describing a design that is quite similar to our Material
classes. We are working on describing this and more in our docs, so please accept my apology that this was not clear from the code.
Please let me describe how we have designed the hierarchy. You can find a brief description of the hierarchy in our docs.
Concrete EC2_2004
and the ConcreteMC2010
are based on two different codes with slightly different names.Back to your suggestion: if I receive your question correctly, I think that we already implemented the material classes similar to what you are suggesting, and we are seeing the benefits that you describe in the end 😃
Please get back to me if you wish to elaborate further on the topic!
Hello,
I would like to propose a structural improvement to this repository that could enhance code organization, flexibility, and maintainability.
Suggestion:
Introduce an Abstract Base Class: Create an abstract base class that defines the common interface and behaviors for all structural design codes (e.g., Eurocode, ACI, etc.).
Specialized Classes for Each Code: Generate child classes for specific structural codes (e.g., Eurocode, ACI 318) that inherit from this abstract class, encapsulating the logic and standards specific to each code.
Example:
Define a base class that enforces common methods and properties that every design code must implement:
Now, specific design codes can inherit from this abstract class and implement their own logic. For instance, a class based on Eurocode 2 (2004) for concrete material properties might look like this:
Benefits:
Reusability: Common methods (e.g., compressive strength, tensile strength) are defined once in the abstract class, reducing code duplication across structural codes.
Maintainability: Changes to shared logic are handled in the base class, ensuring consistency across all code implementations.
Extensibility: Adding a new design code is simplified. For example, adding ACI 318 would involve creating a new class (ACI318Concrete) that inherits from the StructuralCode class, ensuring a scalable approach to adding more design standards.