Using Breeze.js without Entity Framework
Asked Answered
L

1

13

We are trying to develop a SPA using similar techniques and technologies as John Papa's Pluralsight courses (e.g., Web API, knockout, jquery, etc.). However, as a company, we decided to not use Entity Framework. We want to write our server-side data layer(s) using standard ADO.NET.

Now, we're trying to possibly integrate Breeze into our solution. However, even though the Breeze web site says they are not tied to Microsoft, it appears that if you don't use EF, you're going to be in for a long and painful journey with Breeze.

We tried evaluating the NoDB Breeze example, but that thing is very convoluted and difficult to understand (as well as figure out how to implement it in a standard layered arch on the server-side - everything seems to be tightly coupled and is just put in the Models folder of a MVC/Web API project).

So, my question(s) are:

-- Is Breeze the wrong choice for a client-side data library if you're not using EF?

-- If Breeze can be easily made to not use EF and using just straight ADO.NET on the server-side, is there a better example or documentation showing how to do this?

-- Given that our SPA implementation closely resembles John Papa's SPA arch with durandal, knockout, Web API, etc., except (again) we're not using EF, is there a better choice for us than Breeze?

-- And then there's SignalR... We plan on implementing SignalR later, does Breeze even work with SignalR?

Thanks!

Laundrywoman answered 5/8, 2013 at 14:22 Comment(0)
L
7

There are a lot of more specific examples on SO.com, but I want to address a few of your key questions -

We tried evaluating the NoDB Breeze example, but that thing is very convoluted and difficult to understand (as well as figure out how to implement it in a standard layered arch on the server-side - everything seems to be tightly coupled and is just put in the Models folder of a MVC/Web API project).

Depending on what type of database you are using, there are multiple other samples available as well as how-to's available on StackOverflow and on Breeze as well. I could list them out here but if you added what kind of Database you are intending to use it may be a bit easier to provide a better answer.

Is Breeze the wrong choice for a client-side data library if you're not using EF?

Breeze is an excellent choice no matter what kind of back-end that you are using. There are indeed varying levels of difficulty in finalizing your set up, depending on which other technologies you are using, but once you get the hang out of you will look back and laugh at how much easier it was than manually creating your own data library. Here is an awesome example of the free information that is available to guide you through understanding how to use various technologies - Why are my Breeze.js entities not creating ko.observables?

If Breeze can be easily made to not use EF and using just straight ADO.NET on the server-side, is there a better example or documentation showing how to do this?

I would check out some of the other samples that are available, depending on which technologies you are trying to use. Here are a few examples that do not use EF -

Zza - http://www.breezejs.com/samples/zza

  • Angular, MongoDb, Node

Edmunds - http://www.breezejs.com/samples/edmunds

  • Angular with No Database at all, just API consumption

A lot of the time you will find that you only need to use toType in your queries to create entities from your query. Sometimes you will need to go more in depth, but again it depends on technologies.

Given that our SPA implementation closely resembles John Papa's SPA arch with durandal, knockout, Web API, etc., except (again) we're not using EF, is there a better choice for us than Breeze?

There are other client side libraries, JayData is probably the most popular. You probably need to get your team together and make a decision on which technologies make more sense for you to use, taking into consideration alot of different factors independent of our thoughts on StackOverflow.

And then there's SignalR... We plan on implementing SignalR later, does Breeze even work with SignalR?

Updated with Ward's suggestion - SignalR and Breeze would appear to serve different purposes for your application. I think it would be wise to see whether your application will work well with SignalR more-so than whether Breeze will, because of their different concerns.

Levitt answered 5/8, 2013 at 15:50 Comment(2)
Nice answer, PW Kad! Regarding SignalR, it may not be "either/or". I like SignalR for notification and Breeze for getting, managing, and saving data. They work together, each addressing a separate concern. Disclosure: "I like Breeze" in part because I'm a coauthor :)Anetteaneurin
Thank you for your detailed answer(s), PW Kad. I appreciate it. I did see the Edmunds example, but I've never even looked at Angular, so I didn't want that getting in the way of understanding how to use Breeze with Durandal, Knockout, and Web API. But, I'll probably have a look at it later. For now, I've decided to put Breeze on the back-burner. I have a prototype project that needs to be done in less than a month (and I spent literally 4 days trying to figure out Breeze and still couldn't get it working). I'll have to revisit it later. Thanks again.Laundrywoman

© 2022 - 2024 — McMap. All rights reserved.