Sandro Koch
Sandro Koch

Reputation: 315

Generating individual constructor for a model in EMF

EMF generates classes with empty/"super()" constructors. My question is, whether it is possible to say that the constructor of a specific class has to contain certain lines of code? For example, initialize an identifier attribute of a class with an UUID?

Upvotes: 0

Views: 132

Answers (1)

erdal.karaca
erdal.karaca

Reputation: 713

EMF uses the empty default constructor for de-serialization, so do not add anything in the generated classes' constructors. It is common to have a helper class (or service or whatever design pattern you use) that calls the factory methods and do some initialization on the instances they create.

Upvotes: 2

Related Questions