Generating code for static attributes

When you generate code for a static attribute, the initial value entered is generated into a statement that initializes the static attribute outside the class constructor. Consider the following initial values for three static attributes:
Attribute Type Value
attr1 int 5
attr2 OMBoolean true
attr3 OMString Shalom"

When you generate code, these values cause the following statements to be generated in the specification file A.h:

//-------------------------------------------------
// A.h
//-------------------------------------------------
class A {
////    User explicit entries     ////
protected:
    //## attribute attr3
    static OMString attr3;

    //## attribute attr1
    static int attr1;

    //## attribute attr2
    static OMBoolean attr2;
...
};

In the implementation file, A.cpp, the following initialization code is generated:

#include "A.h"
//-------------------------------------------------
// A.cpp
//-------------------------------------------------
// Static class member attribute
OMString A::attr3 = "Shalom";

// Static class member attribute
int A::attr1 = 5;

// Static class member attribute
OMBoolean A::attr2 = true;
A::A() {
};

Feedback