Book a Demo

Author Topic: How to model compile-time switches?  (Read 11786 times)

EricP

  • EA User
  • **
  • Posts: 122
  • Karma: +0/-0
    • View Profile
How to model compile-time switches?
« on: August 28, 2009, 07:02:04 am »
My system will have some compile-time options to configure the software for different applications, e.g. "#define SYSTEM_A" to configure the software to run System "A" and "#define SYSTEM_B"... (etc.).

There will be several other such compile-time switches as well.  All of the switches will be in a separate .h file that will be #include'd in those source files that use them.

What is the best way to model these switches so that they can be included in an EA class diagram, i.e. to show on the diagram which classes use them (by aggregation) and which do not?  

Geert Bellekens

  • EA Guru
  • *****
  • Posts: 13523
  • Karma: +574/-33
  • Make EA work for YOU!
    • View Profile
    • Enterprise Architect Consultant and Value Added Reseller
Re: How to model compile-time switches?
« Reply #1 on: August 28, 2009, 03:40:09 pm »
Do you mean that you'll have one .h file with all the options, or do you have a .h file for each option?
In the first case you could model a class containing all of these option as attributes and then use a dependency from the classes to this options class to indicate which classes use the options file.
In the latter case you might create a class for each option. (maybe with a specific stereotype to indicate that these are compiler options.

Geert