openaccess fluent mapping vs rlinq

8 posts, 1 answers
  1. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 04 Mar 2012 Link to this post

    Hi,

    I can't seem to find the difference between OpenAccess fluent mapping vs rlinq. Can you point me to the right direction?

    Erik
  2. TSE
    TSE avatar
    381 posts
    Member since:
    Sep 2008

    Posted 04 Mar 2012 Link to this post

    Hi Erik, As Per my understanding the fluent mapping is code only. That is. You define all mappings in code and not the visualiser designer.
  3. DevCraft banner
  4. Answer
    Ivailo
    Admin
    Ivailo avatar
    318 posts

    Posted 08 Mar 2012 Link to this post

    Hello Erik,

    Henrik is correct, those options are basically the two approaches you have at your disposal when working with OpenAccess ORM:

    1) Visual Designer approach (where the rlinq file is the model definition) - you can work visually with your model, apply the changes to the database or get schema changes from the database. You can work Model First or Database First

    2) Fluent Mapping - you are defining the mapping declaratively through code. The approach is much more flexible, but a bit harder as a matter of coding effort. 

    You can get the most out of the two approaches if you combine them by using Fluent mapping type when you are adding an rlinq domain model as shown here. However, there are some limitations you need to be aware of should you choose this approach - they are described in a documentation article.

    Let us know if you have any further questions.

    Regards,
    Ivailo
    the Telerik team
    Telerik OpenAccess ORM Q1 2012 release is here! Check out what's new or download a free trial >>
  5. Erik
    Erik avatar
    314 posts
    Member since:
    Feb 2008

    Posted 08 Mar 2012 Link to this post

    Thanks a lot Henrik for you speedy reply. got me going.

    Thank you Ivailo for the links. I will read on with your links and will test a bit.

    Erik
  6. John
    John avatar
    3 posts
    Member since:
    Mar 2011

    Posted 16 Jul 2012 Link to this post

    What are your recomendations as far as project scale in which you would use code first vs visual designer. We are wondering if there is a diminishing returns using code first as the amount of objects in code grows, the difficulty of maintaining them increases.
  7. Serge
    Admin
    Serge avatar
    375 posts

    Posted 17 Jul 2012 Link to this post

    Hello John,

     There are two sides to the story, first it is obvious that working with a huge model and fluent will require a little bit more in terms of maintenance, however the bigger the model gets the harder it gets to work with the designer, as soon as you hit 500 entities you will face certain trouble with reponsiveness of the diagram. 

    What you should also take into consideration is the fact that the FluentAPI provides more (and more advanced) features than the designer. You will not get to map dictionaries, structs or use polymorphic references through the designer. 

    Another thing to think about is the designer wizard, that you will not be able to use with fluent, for example Upgrade From Database applies all changes to the database to your model and creates new classes for you, using the fluent you will need to either work model first, or parallely work on the schema and classes (and fluent mapping). 

    In a few words working with the designer is easier and faster, and if you are spiking or have no time to spare, I would suggest that you use that. However if you want full control of your model, more features and a nice code only approach, then you should use the Fluent Mapping. 

    (Of course, if you already have a huge database that needs mapping, there isn't much sence in going Fluent, as the initial effort of mapping everything will be quite small when using the designer). 

    I hope this is helpful. 

    Greetings,
    Serge
    the Telerik team
    OpenAccess ORM Q2'12 Now Available! Get your hands on all the new stuff.
  8. Warren
    Warren avatar
    7 posts
    Member since:
    Sep 2008

    Posted 14 Aug 2012 Link to this post

    Hello Serge,

    I know that when a model grows, EF Code First begins to take a hit when an application starts up. Essentially, the mapping has to be loaded on application start. There is a possibility to Pre-Generate Views in EF Code First which can help startup time, but I've found it works only some of the time and it can be problematic.

    Does OpenAccess Fluent mapping suffer the same types of issues? Do you know if with a large model there would be an advantage of using the OpenAccess Fluent mapping over EF Code First? If I go the fluent mapping route, am I going to pay a price later on when the model grows in size?

    Thanks,
    Warren
  9. PetarP
    Admin
    PetarP avatar
    754 posts

    Posted 17 Aug 2012 Link to this post

    Hi Warren,

     Generally you should not get any performance hit with your model increasing in size. It is true that during application start we do spend some time in metadata calculation but that time is usually less then a second even with 300+ classes in a model.

    Regards,
    Petar
    the Telerik team
    Follow @OpenAccessORM Twitter channel to be the first one to get the latest updates on new releases, tips and tricks and sneak peeks at our product labs!
Back to Top
DevCraft banner