By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,440 Members | 1,872 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,440 IT Pros & Developers. It's quick & easy.

Subclassing entity object at runtime

P: n/a
My instantiated entity object base type (entityBase) contains virtual empty
validation methods.

To implement runtime validation I need to overriide those validation methods
after object is created.

I need to instantiate new object which is based in existing object but has
validation methods overridden.

How to implement this ?

Andrus.

Jul 29 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Jul 29, 11:17*am, "Andrus" <kobrule...@hot.eewrote:
My instantiated entity object base type (entityBase) contains virtual empty
validation methods.

To implement runtime validation I need to overriide those validation methods
after object is created.

I need to instantiate new object which is based in existing object but has
validation methods overridden.

How to implement this ?

Andrus.
r those objects add something else than validations?
if not you better use an event to do it. in that case is the code that
instantiate your class the one who decide who is going to do the
validation.
Jul 29 '08 #2

P: n/a
Andrus wrote:
My instantiated entity object base type (entityBase) contains virtual
empty validation methods.

To implement runtime validation I need to overriide those validation
methods after object is created.

I need to instantiate new object which is based in existing object but
has validation methods overridden.

How to implement this ?
Generate a new sub class dynamically, instantiate and copy all data
does not seem very practical.

You should split data and validation in two separate classes. One
of them can have a reference to the other.

Arne
Aug 4 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.