Splitting of .rlinq File

8 posts, 0 answers
  1. Richard Koslik
    Richard Koslik avatar
    71 posts
    Member since:
    Apr 2010

    Posted 14 Dec 2011 Link to this post

    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.
  2. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 16 Dec 2011 Link to this post

    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!

  3. DevCraft banner
  4. Richard Koslik
    Richard Koslik avatar
    71 posts
    Member since:
    Apr 2010

    Posted 19 Dec 2011 Link to this post

    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.

  5. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 22 Dec 2011 Link to this post

    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!

  6. Alex
    Alex avatar
    9 posts
    Member since:
    Sep 2008

    Posted 23 Dec 2011 Link to this post

    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.
  7. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 27 Dec 2011 Link to this post

    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!

  8. Alex
    Alex avatar
    9 posts
    Member since:
    Sep 2008

    Posted 27 Dec 2011 Link to this post

    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
  9. Alexander
    Admin
    Alexander avatar
    727 posts

    Posted 29 Dec 2011 Link to this post

    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!

Back to Top
DevCraft banner