OSGi doesn’t need to be in your face

8 Comments

Awhile back on TSS, I complained about OSGi possibly bleeding too much into applications.  That OSGi did not belong within application code.  This IBM article is a prime example of my point.  Here we have standard Spring code and XML.  Nowhere in there do you have OSGi APIs.  Yet, you get OSGi classloading and lifecycle.  I bet, that if you can’t already right now, Spring will eventually be able to register IoC references as direct dependencies within an OSGi kernel.  There’s really no reason or advantage to have OSGi APIs bleed into application code.

Another example is JBoss 5.  While not running on top of an OSGi kernel (instead its running on JBoss’s own special kernel) it can manage dependency and lifecycle for a variety of different component models like:  Spring, JBoss MC, EJBs, JCA adapters, Queues, Topics, Servlets, etc.  This can work because JBoss’s kernel provides a deployment abstraction and framework to publish and manage inter-component dependencies.  The end goal here is that all these different component models can take advantage of all this dependency management without writing to specific APIs and to stay within the confines of their own component model’s specification.  The metadata is there.  The dependency information is there.  There’s no reason to write to a specific deployment API to leverage these types of services.

This is what I had hoped OSGi would become.  A standard kernel where classloading, deployment, and dependency management would be provided as low level services so that existing and new component models would have a standard way to mix and match themselves and to deploy themselves.  In theory, such a kernel would allow JBoss’s Transaction Manager to run within a Web Logic server.  JBoss’s EJB container to run within Websphere.  Sun’s WS-* implementation to run within JBoss.

Maybe my concern is not real.  Maybe most OSGi evangelists are not positioning OSGi as an application API.  Let’s hope they aren’t.

REST needs Polymorphic XSD

5 Comments

I was thinking alot about REST and service versioning again today.  In my previous blog I talked a bit about using the media type and probably XML schema to guarantee a contract between the client and server.  The client would ask for “application/vnd1+xml” and be all set for its conversation to begin.

The big problem I see with this is a service maintenance problem.  As you rev your service and your schema you’re going to have to support a lot of different media types.  What would make things easier is if XML Schema supported polymorphism.  That way a client could ask for “application/vnd1+xml” format and still receive and validate a newer version of the schema.  Please correct me if I’m wrong, but I don’t think you can do this in XML schema.  Yes you could extend various types from the parent to create a newer version of a schema, but a validator would not be able to enforce a polymorphic relationship with its parent AFAIK.

Clients and servers could get around this XSD problem by not doing validation and hoping that the schema developers are disciplined enough to make future versions of the format backward compatible.  It just seems incomplete to me to not be able to validate.

MediaType as Your IDL

1 Comment

I was reading recently a very excellent article by Subbu about Describing RESTFul Applications.  I highly recommend the article as it very clearly illustrates the RESTful principle of HATEOAS.  One of the profound questions the article asks is does REST need a description language like IDL or WSDL? I guess the main arguments for this would be:

  • Tooling.  Would be nice to be able to generate some client and server code to avoid all the boilerplate nonsense you usually have to do.
  • Define an enforceable contract that can be validated.

There is something called WADL out there, but, as Subbu sort of hints at in his article, such an approach encourages an RPC-like approach for defining interactions with your application.  He goes on to describe what he feels like might be a good definition language while, at the end, asking the question of: Is it Practical? with the biggest roadblock being:

How about software tools that want to test or enforce the contract? It is possible to create such software that reads the above machine-readable description to do the following at runtime.

  • Check that the media types of representations are predefined.
  • Check that the representations match the predefined descriptions of media types.
  • Check that all links contained in representations have predefined relations and media types, and that the URIs included follow predefined URI patterns.

I am not aware of any software that can validate these in this manner.

My answer to this question and roadblock is, why not have your media type define your entire contract?  Require that certain links and relations be a part of your document and define them explicitly in your XSD.  Maybe even the atom link’s media type should be required as well.  Then, simple XML validation can guarantee the contract.  The client application locks in the contract simply by specifying an Accept header containing a custom media type with its initial URI traversal.  We still get a lot of decoupling because the endpoint URIs are discovered at runtime yet we have something we can both generate code from and enforce a contract through.  Add in URI Templates to your links and all you’re missing is what HTTP methods are allowed to be invoked.  Using schema to enforce your contract doesn’t have to stop at XML as mappings like BadgerFish and tools like Jettison have shown.

All and all, the more I think about it, the more I believe that Human Documentation plus a schema is all that is needed in the RESTful world.  I’m glad that as more people like Subbu think and analyze through the IDL problem there are less and less reasons to have an IDL for REST.

Obama to the rescue

5 Comments

I listen a lot to talk radio, specifically WEEI Sports radio, and 96.9 FM Talk Radio in the Boston area. Unfortunately, when it comes to politics, all you hear on talk radio is conservative, right wing viewpoints. I do live in Massachusetts, so don’t ask me why all this right wing propaganda pollutes our airwaves. I guess this is because right-wing politics tend to piss a lot of people off and drive up ratings. I don’t know. You got me, a liberal democrat listening to them, so I guess the ploy has worked.

One thing I heard a lot after Obama’s first address to Congress was conservatives attacking Obama’s speech and the stimulus. You hear nitpicks about how Texas is getting a cheerleading museum. Stuff like that. Showing bloat that when compared to the overall size of the stimulus package is pretty insignificant. What I wanted to do within this blog is call attention to a few of the good things that are in the bill.

Last summer I joined our Town’s Finance Committee. The Finance Committee’s job is to review all departmental budgets in town and to submit an overall base budget for the entire town. I couldn’t have picked a more interesting time to join. The economy has stalled town growth which means very little new revenue growth. Massachusetts state revenue is also way down which has put local aid funds in serious jeopardy. The contracts for our Police, Fire, and Teachers are all up for renegotiation. Add to this Massachusetts Proposition 2 1/2 which forbids local communities to raise taxes more that 2.5% without 2/3 of the town voting to support a tax increase. It has turned out to be a very tight budget year.

In a tight budget year, we all know what takes the brunt of any cuts. The school system. Our school is faced with probable cuts in funding to after school programs, children supplies, furniture, and even textbooks. There’s also the very real danger of staff reductions and increased class sizes as well as we’re dangerously close to the 2.5% threshold.

The federal stimulus package couldn’t have come at a better time and is affecting our budget in three possible separate ways

  • Special Education.  Massachusetts law requires kids with special education needs to be supported by the community and integrated with the school.  A special needs kid moving into town can have a huge impact on the schools budget as they cost a lot more than a regular student to educate and support.  For example, in our town, new special ed kids account for 25% of the growth of the schools budget.  During the Bush Administration ‘W’ set up guildelines for special education, promised funding, but never delivered.  It looks like the stimulus is providing the promised funding.  This results in hundreds of thousands of dollars being put into the school system.
  • It is not fully clear yet, but it looks like the stimulus package will help fully fund the shortfall of state education aid.
  • Obama wasn’t lying when he said our schools were crumbling.  Our 40-year old roof started leaking into a 4th grade classroom due to the severe weather we’ve been having this winter.  The kids had to be moved to another area in the building.  There is a high possibility the stimulus will help us fund putting in a badly needed roof.  Our junior high and high school also have new roofing needs that have been put off.

I know the conservatives among you will never ever admit that the stimulus is doing any good, but I hope those of you on the fence at least have had their eyes opened to some of the good.  Too often the media (even the liberal media) focuses too much on the eyebrow-raising parts of politics and never really sheds light on the true reality.  Hopefully this blog has done a little to shed some light on things.

RESTEasy 1.0.2.GA Released

Leave a comment

More bugs found by our users. See our release notes on 1.0.2.GA for more details.

Next release will be 1.1-RC1 beginning of March which will introduce client and server side interceptors. Client side “Browser” caching. Server side cache support. GZIP encoding support

RESTEasy 1.0.1.GA released, Minor Bug Fixes

2 Comments

Users found a few minor bugs with 1.0.GA.  See our release notes on 1.0.1.GA for more details.  Unless there is a critical bug reported, no releases until March.

Writing RESTFul Java Book

16 Comments

I’ve contracted with O’Reilly to write a “RESTFul Java” book about REST, Java, and JAX-RS.  Should be out sometime this summer.

RESTEasy in eWeek

2 Comments

Darryl Taft did a nice piece on RESTEasy.  Thanks Darryl!  It is always cool when eWeek finds the stuff we’re doing at JBoss news worthy :).

RESTEasy 1.0.0.GA Released!

2 Comments

See more info on blogs.jboss.com.

RESTEasy 1.0-RC1 Released: Need help finalizing GA!

Leave a comment

RESTEasy 1.0-RC1 has just been released.  Please see our main project page and follow links to documentation and downloads.  Not much new functionality in this release.  After 77 days of waiting for Sun to allow us to download the JAX-RS TCK, I was able to pass all TCK tests after a fixing a few minor bugs.  1.0-RC1 reflects these changes.

Onward to 1.0 GA!

After a 2 week incubation of RC1, 1.0 GA will be released (sometime January 21st) and will be fully certified with Sun as a JAX-RS implementation.  I need your help finalizing the GA release! Specifically

  • I need existing RESTEasy users to upgrade and test their applications.
  • I need pointers on improving usability
  • Documentation improvements
  • Bugs reports and patches are always welcome too!

Since the window for the GA is only 2 weeks, there’s not a lot of features I can accomodate in the usability department, but I will try.

Older Entries Newer Entries