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

openaccess fluent mapping vs rlinq

7 Answers 518 Views
Getting Started
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Erik
Top achievements
Rank 2
Erik asked on 04 Mar 2012, 06:40 PM
Hi,

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

Erik

7 Answers, 1 is accepted

Sort by
0
IT-Als
Top achievements
Rank 1
answered on 04 Mar 2012, 08:07 PM
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.
0
Accepted
Ivailo
Telerik team
answered on 08 Mar 2012, 03:31 PM
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 >>
0
Erik
Top achievements
Rank 2
answered on 08 Mar 2012, 06:12 PM
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
0
John
Top achievements
Rank 2
answered on 16 Jul 2012, 11:58 AM
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.
0
Serge
Telerik team
answered on 17 Jul 2012, 03:05 PM
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.
0
Warren
Top achievements
Rank 1
answered on 14 Aug 2012, 02:55 PM
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
0
PetarP
Telerik team
answered on 17 Aug 2012, 01:34 PM
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!
Tags
Getting Started
Asked by
Erik
Top achievements
Rank 2
Answers by
IT-Als
Top achievements
Rank 1
Ivailo
Telerik team
Erik
Top achievements
Rank 2
John
Top achievements
Rank 2
Serge
Telerik team
Warren
Top achievements
Rank 1
PetarP
Telerik team
Share this question
or