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

Splitting of .rlinq File

7 Answers 115 Views
Feature Requests
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Richard Koslik
Top achievements
Rank 1
Richard Koslik asked on 14 Dec 2011, 08:24 AM
Hello ORM-Team,

it would be nice to have more Domain-Model (.rlinq) files within the same Modelname.
Lets say like the partial classes...

This would be a great help for the project structure to dont have all entities in the same file...

Thanks in advance,
Richard.

7 Answers, 1 is accepted

Sort by
0
Alexander
Telerik team
answered on 16 Dec 2011, 05:42 PM
Hi Richard Koslik,

Do you really want to split the model to multiple rlinq files or you just want to organize the generated classes better? Please note that maintaining multiple rlinq is more difficult and you might not be able to define associations between the different parts of the model. Additionally, all rlinq files will have to be merged at some stage, so that the whole metadata is available to the runtime.

What you can do at the moment to organize the generated classes is to use separate namespaces for the different logical groups of classes and enable the Generate in nested namespaces option from the model settings. This way the classes will be generated in separate project folders for each namespace. If your tables are already placed in different schemas, you could also enable the Use schema names as namespaces option in the Add new item wizard, so that the classes are generated automatically in separate namespaces, based on the schema names.

I am asking these questions because we would like to know what is your motivation to use multiple rlinq files for the same model, perhaps the same could be achieved with one rlinq but with more customized code generation.

All the best,
Alexander
the Telerik team

Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Richard Koslik
Top achievements
Rank 1
answered on 19 Dec 2011, 09:02 AM
Hello,

1. one point is the visual organisation in the rlinq file.
2. to don't blow up the memory with the whole metadata of hundreds of entitys if only a few are needed when loading a module(xap) at runtime and using the DC.
3. associations between the different rlinq's is not a must have (if you mean to use them together in a linq statement)
4. the main aim is to keep memory usage as low as possible.

5. why is it needed to merged all rlinq's at some stage?

Also a way could be to have more than one rlinq with different domain models, if this is a easier way for you.
I have tried this, but it does not work as expected.
As there is no interaction between the rlinq's, you may need one table in both DC, but this results in strange behaviour...

regards Richard.

0
Alexander
Telerik team
answered on 22 Dec 2011, 10:01 AM
Hello Richard,

The main obstacle of maintaining multiple rlinq files is that OpenAccess caches the metadata based on the connection string associated with the model. So the first time you create a context for one of the models, the metadata from only this model will be associated with the connection string used. Later, if you try to use the same connection string with a context from another rlinq file, you would get an exception for missing metadata. That is why you would need to merge the metadata from all models before instantiating the first context. The metadata could be merged later as well, but this requires disposing of the initially cached metadata.
This problem can be easily avoided by using a connection string with a unique name for each model, and I suggest you to use this approach, since you are not always using the whole model at runtime. 

Having one table mapped in several models should work as long as the classes mapped to this table are in different namespaces.
Hope that helps.

All the best,
Alexander
the Telerik team

Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Alex
Top achievements
Rank 1
answered on 23 Dec 2011, 11:00 PM
You are think about split the model to multiple rlinq files BUT you can think to reorganize the view for a big Model. I have a Model with 340 tables and ins't readable to see it all together.

One idea is to have a property named "Groups" for each entity in the model view so I can set for example "Security;General". In the top of the ModelView you can put a ComboBox to allow user to view only Entities that contains the group.

It is only a View modification so you don't need to change anything in your Architecture.
 
See the attached mock.
0
Alexander
Telerik team
answered on 27 Dec 2011, 04:02 PM
Hi Alex,

You are absolutely right, we have also thought about this (or similar) approach but it would require considerable effort to implement and it is still with low priority on our TODO list.

The functionality that is currently in the designer and could improve the user experience when working with large models is the coloring of entities, the birdview in the lower right corner of the diagram and the Locate in Diagram command available in the OpenAccess Model Explorer. I hope that they will help you with the navigation until we implement a better view over the model.

Regards,
Alexander
the Telerik team

Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

0
Alex
Top achievements
Rank 1
answered on 27 Dec 2011, 05:35 PM
Hi Alexander,

Yes. I'm using colors but isn't good for Model with many relations. Same entity must appear in many (View).

Do you have a roadmap for the next realease ?

Thanks,
Alexnaldo Santos
0
Alexander
Telerik team
answered on 29 Dec 2011, 05:21 PM
Hello Alex,

You are absolutely right.
Unfortunately our roadmap for Q1 is not publicly available yet. We have already planned for other usability improvements with higher priority and the multiple view functionality will have to wait some more time. 

All the best,
Alexander
the Telerik team

Q3’11 of Telerik OpenAccess ORM is available for download. Register for the What's New in Data Tools webinar to see what's new and get a chance to WIN A FREE LICENSE!

Tags
Feature Requests
Asked by
Richard Koslik
Top achievements
Rank 1
Answers by
Alexander
Telerik team
Richard Koslik
Top achievements
Rank 1
Alex
Top achievements
Rank 1
Share this question
or