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

Relationship that spans across multiple models

7 Answers 72 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.
Seabus
Top achievements
Rank 1
Seabus asked on 14 Jul 2011, 06:55 PM
Hi,

I'm using OpenAccess and I created multiple models  ( e.g I have one model for the part of the application that handles user management, one model for the part of the application that deals with products ) ........

I was wondering how do I create a relationship ( association ) that spans across multiple models ?

Thanks.

Seabus

7 Answers, 1 is accepted

Sort by
0
Zoran
Telerik team
answered on 15 Jul 2011, 12:11 PM
Hello Seabus,

 Unfortunately there is no such feature in the Visual Designer at the moment. The models are self-contained and you are not able to mix them with such logical relationships. We are planning on a feature that would allow similar behavior for the next release but i would not promise you that on this stage yet.

Best wishes,
Zoran
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

0
Igor
Top achievements
Rank 1
answered on 09 Aug 2011, 02:45 PM
I am also interested in support of mechanisms allowing to build hierarchy of models for complex schemes.
It would allow to collect a composition of models sufficient for realisation of the concrete module. It would allow to get rid of superfluous dependences on not used parts of the scheme and to avoid rebuilding of other modules.
I have seen something similar in the description to AggregateMetadataSource. But as I have understood it concerns Fluet API.
0
Serge
Telerik team
answered on 11 Aug 2011, 02:39 PM
Hi Igor,

 Unfortunately at the time being it is rather hard to create such a setup, this being merging a couple of models with inheritance relationships between them as well as normal relationships. This is only possible if you have defined your model using the Fluent Mapping API as you have correctly guessed. 

If you are interested in that particular approach do try out the AggregateMetadataSource tutorial and see if that works for you.

I hope this is helpful.

Regards,
Serge
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Igor
Top achievements
Rank 1
answered on 11 Aug 2011, 03:15 PM
Complexity of a composition of schemes is clear.
But I do not represent as to evalute  the big scheme by means of Fluent API.
What about of other type of splitting of the scheme?
We will assume we have the superscheme for the designer which contains all information as now, but we have other type of the scheme (view или  partial scheme) mapped to a part of the superscheme and containing only domain classes.
Rules of mapping  should provide demanded restrictions: if not nullable properties not mapped - class must be read-only, you cannot map class with reference to class not in same schema and so on.
During assemblage such scheme inherits backend information for covered area.
It is clear that I can generate such new MetedataContainer  from MetedataContainer of superschema  by  Fluent API.
But here again a mix of approaches: visual design and coding.

There are other offers for work with the big schemes?
0
Serge
Telerik team
answered on 16 Aug 2011, 11:00 AM
Hello Igor,

 There a couple of thing that you can you. One would be to have a model that contains all of the mapping available, all classes and schemas that you have, that you then during runtime split into a couple of smaller ones, however this does not help with design time issues. 

The other solution would be to have a couple of small models that you then assemble in one big one, which is usually harder. You can merge two containers that have nothing in common with no problem, no matter how they were developed, be it visual designer or fluent mapping. 

If you however want to be able to define associations (or even inheritance) between these models you will need to have them defined through the Fluent Mapping. The problem with the visual designer is that the classes developed are generated by the designer and thus cannot have inheritance to classes that are not parts of the model, but rather are a part of another model. 

Another solution would be to have a set of classes that are available in all models, for example the base class of the inheritance, when you try to aggregate two models that contain the information for these common classes, if they are defined exactly the same they will be merged into one class and this should provide a valid container that you can then use. 

Basically I would urge you to use Fluent Mapping as it is the API that provides the most robust mapping capabilities and a lot of advanced features that I assume you will need with such a complicated model. The AggregateMetadataSource has been developed with the Fluent Mapping in mind. 

I hope this proves to be helpful.

Best wishes,
Serge
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

0
Igor
Top achievements
Rank 1
answered on 16 Aug 2011, 11:15 AM
Thanks big for the review.
As I have understood from other articles Visual Designer is created for the simplified approach.
I intend  to make use of our own old experience of construction ORM of the module (probably with our modified designer) having  combined it with flexible possibilities of Fluent API for model generation and  considering your offers.  
0
Serge
Telerik team
answered on 18 Aug 2011, 04:02 PM
Hi Igor,

 I am glad that you have been able to find a suitable way to develop your application. We are looking forward to hearing back from you.

Do let us know if you face any trouble or need advice.

Best wishes,
Serge
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get now >>

Tags
General Discussions
Asked by
Seabus
Top achievements
Rank 1
Answers by
Zoran
Telerik team
Igor
Top achievements
Rank 1
Serge
Telerik team
Share this question
or