2

I'm trying to develop an application with a following layers:

  1. Entity Framework Model
  2. Data Service (either WCF or Web API, but I prefer Web API)
  3. Java Script + HTML + CSS Client

The model contains inheritance and polymorphic collections:

public class Master
{
    public virtual ICollection<BaseDetail> Details { get; set; }
}

public abstract class BaseDetail
{
    public virtual Master Master { get; set; }
}

public class Detail1 : BaseDetail { }
public class Detail2 : BaseDetail { }
public class Detail3 : BaseDetail { }

The problem is that I couldn't find a Java Script framework suitable for my needs:

  1. Knockback
    • pros:
      • supports inheritance and polymorphic collections very well
      • supports Web API & JSON (I think it's simpler than WCF & oData)
    • cons:
      • doesn't support EF metadata. You have to duplicate a model in java script by hands
      • doesn't understand JSON-serialized EF-model well enough. You have to pre-, post-process JSON
  2. Breeze.js
    • pros:
      • supports EF metadata very well. JS model is generated on the fly
    • cons:
      • doesn't support inheritance
      • doesn't support WebAPI + JSON
  3. JayData
    • pros:
      • supports EF metadata well enough
    • cons:
      • it seems that it supports inheritance, but doesn't support polymorphic collections
      • doesn't support WebAPI + JSON

Are there any other alternative JS-frameworks? Or maybe I'm wrong about named frameworks? Can you provide an example? Thanks!

John Papa
  • 21,880
  • 4
  • 61
  • 60
Denis
  • 1,167
  • 1
  • 10
  • 30
  • 1
    why do you think that breezejs's support for metadata is very well and jaydata's is well enough only ? (I work for jaydata) – Gabor Dolla Nov 12 '12 at 08:37
  • Because it generates JavaScript-model on the fly. There is no need to call JaySvcUtil.exe. But I think it's very subjective advantage... The model isn't change too often, and it's not problem to call the util. – Denis Nov 20 '12 at 17:08
  • Thanks for the clarification! Actually we can do both ways with pregenerated model and without it. The syntax for getting the context is slightly different. Most of our examples use static schema so that might be misleading, sorry for that. If you use jaydata as odata client in nodejs on windows we only support static context as libxmljs does not compile on windows. – Gabor Dolla Nov 21 '12 at 15:25

2 Answers2

6

Edit: As of v 1.3.1 Breeze now DOES support inheritance.

--

With respect to Breeze, you are correct that it does not (yet) support inheritance. That is on the Breeze road map and you might want to vote it up.

It does support the ASP.NET Web API and JSON. Curious that you thought otherwise, given that almost all BreezeJS samples are Web API samples that rely exclusively on the JSON content type.

Jay Traband
  • 17,053
  • 1
  • 23
  • 44
Ward
  • 17,793
  • 4
  • 37
  • 53
  • Yep, 3 votes are mine. I mean that the sample controllers (you talking about) aren't true REST. There are no get/put/post/delete, just oData in them. So I think it's not trueЪ Web API. Just a variation of a WCF Data Service. – Denis Nov 20 '12 at 17:05
  • You're right about JSON too. But I mean that it's not plain, simple JSON, it contains metadata. For example, this JSON isn't compatible with Backbone. – Denis Nov 21 '12 at 01:43
2

JayData support for WebAPI is available with the Microsoft Web API OData extension. Though it needs you to setup the server side in terms of Controllers, Routes, etc.

We would be very happy to work on polymorphic collections with a priority, we are currently right in the process of implementing OData V3. Open an issue on http://github.com/jaydata so that we can contact you on the details.

Peter Aron Zentai
  • 11,482
  • 5
  • 41
  • 71