RestCrudEnhancements

Enhancements for the REST CRUD Generator (P1) and Spring Integration (P2)

(I am lumping two features here because from the implementation perspective, they are related.)

Justification

The CRUD generator feature has been around since May 2007 but has not seen any major enhancement since then. We are also noticing that people are starting to try out the feature but are not happy with the quality and the way certain things are done, e.g., the way we handle persistence and transaction. So, this feature is in desperate need of attention. Furthermore, this can potentially be a showcase feature for the Network.com. Therefore, I consider this a P1 feature for NetBeans 6.5.

As for Spring integration, it is important because JSR-311/Jersey does not support EE meaning no support for code injection for UserTransaction, EJB refs, etc. However, Jersey does support the Spring framework. So, if we can port our CRUD generator to support Spring, we can take advantage of the IoC capability provide by Spring to support transaction and persistence. Furthermore, this will also be a stepping stone for supporting EE 6. Once EE 6 is out and JSR-311 supports it, we should be able to migrate the CRUD generator to work against EE6 with minimal changes.

Description

The following is a list of enhancements I would like to see implemented for the CRUD generator

  • Support for Jersey 0.8
  • Currently scheduled to be released on 6/20 or 7/25 (I'll find out what the real date is going to be.)
  • Converter Enhancement
  • There have been complaints about the lack of information being returned in our data representation. For example, when we return a collection of customers, we would return a collection of references and the client application will need to make additional request on the url specified by each reference to get the actual information of the customer. The result is increased network track even though this is truely RESTful. To work around this issue, we will do away with references. Instead, we will give users the ability to specify when to expand or collapse a reference via a query parameter called expandLevel. For exmaple, /customers/?expandLevel=1 will return a collection of customers with all the non-reference fields included in the representation. The reference field will only contain an url.
  • Query Support
  • Allow specifying a query in the URL to constraint the resulting data returned For example, /employees?query="salary > 10000"

would return all the employees whose salary is greater than 100000.

  • Support for auto-generated primary key
  • This is a very common use case which we currently don't support.
  • Caching support
  • Allow a client such as the web browser to query the service to determine if it needs to refetch the data. We will use the pre-condition feature in the jsr-311 api to do this.
  • Revisit generated PersistenceService
  • improve our generated PersistenceService to make it adapt to different environment and be able to support JTA. In addition, we also need to figure out how to make it a managed service so we can take advantage of code injection for EntityManager and UserTransaction.
  • Development of RESTful services directly from DB
  • This will provide a more RoR-style experience. There is an API from the JPA module we can use to implement this enhancement.
  • Support for Entity Inheritance
  • It is very common for people to create entity classes using inheritance. We currently don't properly support this. For example, it is possible to run a query that would return a collection of full-time employees and part-time employees. Our converter needs to be able to handle this case correctly.
  • Add Spring support and adapt the CRUD generator to support Spring (P2)
  • We need to first investigate how the CRUD application would work under Spring especially in the area of persistence and user transaction.


Schedule

The implemetation tasks for this feature will be split between Rico and Peter. Since Rico will not be available for M1, Peter will be the sole developer working on the enhancements. For M2, Rico will pick up the remainder while Peter will dedicate %90 of his time working with other groups within Network.com.

*Task* *Owner* *Date* *Comment*
Jersy 0.8 Peter 1 day completed on 6/20
Converter Enhancements Peter 3 days completed on 6/10
Query Support Peter 3 days completed on 6/13
Auto-generated Primary Key Peter 2 days completed on 6/10
Caching Support TBD 3 days
Revisit PersistenceService Peter 1 week completed on 6/13
Generation Directly from DB Rico 1 week
Support for Entity Inheritance Peter 3 days
Spring integration TBD 2 weeks
Not logged in. Log in, Register

By use of this website, you agree to the NetBeans Policies and Terms of Use. © 2012, Oracle Corporation and/or its affiliates. Sponsored by Oracle logo