Skip to content

Latest commit

 

History

History
15 lines (10 loc) · 1.02 KB

CodeArchitecture.md

File metadata and controls

15 lines (10 loc) · 1.02 KB

Code Architecture

In the openstudio-standards library, each code or standard (such as ASHRAE 90.1-2013) is represented by a Class. Because many different standards share code, instead of having many copies of the same code, code reuse is accomplished through inheritance.

Here is the typical inheritance pattern:

  • Standard (abstract class)
    • ASHRAE901 (abstract class)
      • ASHRAE9012004 (concrete class)
      • ASHRAE9012007 (concrete class)
      • ASHRAE9012010 (concrete class)
      • ASHRAE9012013 (concrete class)

Methods that are implemented in the Standard class are used by the inherited classes such as ASHRAE90120013. However, if ASHRAE90120013 has special requirements, it can reimplement some or all of the methods found in Standard. These reimplementations can use their own logic. These reimplementations will only be used by objects of the type ASHRAE90120013, they will not be propagated back up to the Standard class, or to any other Standards such as ASHRAE9012004.