Question

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!

Was it helpful?

Solution

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.

OTHER TIPS

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top