p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   .NET 4.5.1 and Visual Studio 2013 General Discussions (http://p2p.wrox.com/forumdisplay.php?f=759)
-   -   Learning Entity Framework 6, visual basic .net 2013 (http://p2p.wrox.com/showthread.php?t=93373)

amc4042 August 7th, 2014 04:35 PM

Learning Entity Framework 6, visual basic .net 2013
 
I am learning .NET do develop a business (data-centric) application in VB .NET and VS2013 Express.
It will have 3-Tier architecture. For the Data layer (working against a SQLServer Database, or MySQL, or generally speaking, against any relational DB), I am thinking of using Entity Framework (latest version, 6.0, I believe), to handle the decouplement between relational-design and class-based-design.

I would like to hear opinions about my choice and sources for learning (tutorials, books,...), but in VB.

Another opinion I would like to hear about is Stored-Procedures yes or not. I would like to avoid them, but maybe I am too drastic.

I don't know if MVC is related to what I am exposing here, but I prefer to avoid that component or approach.

thanks

mmorgan30 August 7th, 2014 08:52 PM

In my opinion the entity frame work and linq to entities is one of the greatest frame works to hit the development scean in a long time. it greatly decouples data access and perstance from your application devlopement and you end up spending more time where it realy counts i.e. the presentation and bussiness tiers.

In todays data centric applications; robost and dynamic slns are the key and the entity framework offers all that is needed to write complex data access but in the language that you excell in i.e. C# or VB.

stored procedure have there place, but in my exprience with data centric sites i find them more cumbersome than helpful.

a pet peave of mine when working on an application that was stored procedure driven, is when i go write some presentation for some data that is currently no there and i end up writing code in 3 different layer to get there i.e. the presentation layer, bussiness layer, and the back in plumbing. with the entity frame you see with a quick adjustment to you linq to entities query and if you have properly set up data binding you have only changed code in one place. not only does it allow for minimal coding, but in your bussiness logic you find that if you needed a simple query to get one more peice or data that you did not forsee, well with the entity frame work its childs play to get it, with a stored procedure diven application you have write all supporting logic and store procedure to get that information.

another benni is that the entity frame work makes paging data a snap for binding to paged gridviews.

i.e.
MyDBContex.MyTable.Skip( pageNumber * rowsInpage ).Take( rowsInpage );

and no sql or stored procedure written.


to do a simple data transform on the query
MyDBContex.MyTable.Skip( pageNumber * rowsInpage ).Take( rowsInpage ).Select( r => new { Filed1 = r.Field1, Field2 = r.Field2 } )

and again no sql or stored procedure written but i have different view of the same data.


so in conclusion for data scentric site i have to put a thumbs up for entity frame work and thumbs down for stored procedure.

the book that i use as my bible for linq ( and in my opinion is the heart of entity frame work ) is Pro linq and it comes in C# or VB, it really gives you an understanding of the power of this framework.

as for getting in the front end of entity frame work i.e. code first, model first and the such any book on entity frame work 4 and up should give you the needed information to get going with setting up your data models.

for some stellar tutorial check out www.asp.net

amc4042 August 8th, 2014 03:22 AM

thanks a lot. I have downloaded the Pro Linq and will start my journey on the subject.

I have checked asp.net as you suggested, and see many examples of combining EF6 and MVC... I don't know what MVC is, but for what I read, I would prefer to avoid it. I mean that I wish to use EF6 but NOT use MVC, if this is makes any sense.

My approach (Code/Model/DB) is DB, since I am used to think in "relational" terms. From the DB I will de-normalize to get classes / datasets (or whatever) that are useful for the work to be done in BL and Presentation Layers (for instance, members with overdue bills, or members of a certain sport, or any person in DB except suppliers,....)

thanks again

mmorgan30 August 8th, 2014 10:23 AM

MVC (model, view, controller) is another flavor of project set up. I my self prefer ASP.net web pages over MVC, but it is the latest craze.

You can use entity frame work with any application type, it is project independent.


All times are GMT -4. The time now is 11:34 AM.

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.