In Structuraid we need to have a system where we centralize all the information regarding design requirements coming from codes and standards. Since these codes are usually mandatory on a regional/country basis, it would be useful for us to be able to support multiple design codes and use one of them according to the project setup.

Here’s the following diagram that explains how the DesignCodes system will work

Untitled

The system is composed of the following abstractions

System Usage

The first thing to do before using the design codes system is to call the resolver in order to point to the right namespace that the project will need to use:

design_code = DesignCodes::Resolver.use('nsr_10')

The resolver will return as a result the namespace that should be used later to call any requirement that needs to be made. For example, if you need to compute the elastic modulus according to the design code, do this:

design_code::RC::ElasticModulus.call(design_compression_strength: 28)

Error Handling

Each Code Requirement abstraction will raise one of the following errors if something went wrong: