This is a migrated thread and some comments may be shown as answers.

Way to modelling inheritance without the designer

2 Answers 49 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Norbert
Top achievements
Rank 2
Norbert asked on 14 Oct 2011, 09:47 AM
Hello,

Can you tell me if there is a possibility to extend the generated domain classes with interfaces, abstract classes etc.?
Because the classes are partial I can do but the designer doesn't "recognize" that and when I want to update my database schema it's not associated with the changes.

For my understanding I have to model inheritance within the designer and extensions (almost ever methods) with separated partial class files.

Just give me a sign,
thank you in advance
Norbert

2 Answers, 1 is accepted

Sort by
0
Ivailo
Telerik team
answered on 18 Oct 2011, 01:46 PM
Hello Norbert,

Interfaces are something you can use with Telerik OpenAccess ORM in a two different ways. First, you can create interfaces in your Visual Designer, so that they will be part of the automatic code generation and the properties will be persistent. This functionality is not finalized yet - you will not be able to use the classes implementing an interface in a polymorphic manner. We are planning to include this feature in one of the future releases.

The other option would be to define the interfaces separately and implement them in partial classes (for your Domain Classes), which will be relatively independent from the auto-generated classes. This way you will prevent your implementation from being replaced by the code generation. The disadvantage is that the fields of those interfaces will not be persistent at all.


As per the abstract classes, they do not have direct representation in the Visual Designer, so you will have to follow the partial classes approach. In case your abstract classes have some persistent properties, you can model them as normal Domain Classes and limit their usage otherwise, like a private constructor for example.

Do not hesitate to get back to us if you have any questions.


Best wishes,
Ivailo
the Telerik team

Check out the latest stable build of Telerik OpenAccess ORM. Download it and benefit from our new Project Templates.

0
Norbert
Top achievements
Rank 2
answered on 24 Jul 2012, 01:24 PM
Hello,

thank you for answering!
I will use OA only for database access snd perform any modelling on the business layer I think.

Because I have to work with a large amount of data I have to design the database model first, thats often not the perfect domain odel ;-)

regards Norbert
Tags
General Discussions
Asked by
Norbert
Top achievements
Rank 2
Answers by
Ivailo
Telerik team
Norbert
Top achievements
Rank 2
Share this question
or