missing: constructor visibility modifier

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
mindplay
Posts: 148
Joined: Tue 13 Dec 2011 22:58
Location: Ithaca, NY

missing: constructor visibility modifier

Post by mindplay » Tue 03 Jan 2012 21:57

I can control the modifier of a Class, but it appears there is no way to control the modifier on the auto-implemented constructor?

I have many cases where the type itself is public or internal, but access to the auto-generated zero-argument constructor needs to be restricted.

There are many common cases where constructing a valid instance of a given type is impossible without a particular argument; for example, cases where some type of child-object is not valid without specifying the owner-object.

Taking a literal example, let's say we have types Door and House. We don't want Doors in our model (or database) that don't reference the House they're attached to - in this case, the generated zero-argument public constructor poses a problem, since it enables you to construct instances of Door that violate this constraint; the constructor must be made private, and I must implement a public Door constructor that requires a House argument.

I could certainly add this feature myself, but it seems like it's going to be a common requirements. Any chance you plan on adding that feature?

Helen
Devart Team
Posts: 127
Joined: Wed 07 Sep 2011 11:54

Post by Helen » Wed 04 Jan 2012 15:25

Thank you for your suggestions. They help us to improve our product.

We will implement this feature. We will post here when the corresponding build of Entity Developer is available for download.

Helen
Devart Team
Posts: 127
Joined: Wed 07 Sep 2011 11:54

Post by Helen » Thu 12 Jan 2012 15:20

The new 'ConstructorModifier' extended property, which allows controlling access for the class constructor, is added for entities and complex types.

This feature is available in the latest 4.2.110 build of Entity Developer.
It can be downloaded from http://www.devart.com/entitydeveloper/download.html (trial version) or from Registered Users' Area (for users with valid subscription only).
For more information, please refer to http://www.devart.com/forums/viewtopic.php?t=23135 .

Post Reply