My Photo
E-Commerce Service
Amazon E-Commerce Service (ECS) exposes Amazon's product data and e-commerce functionality.

Elastic Compute Cloud
Amazon Elastic Compute Cloud is a web service that provides resizable compute capacity in the cloud.

Historical Pricing
The Amazon Historical Pricing web service gives developers programmatic access to over three years of actual sales data for books, music, videos, and DVDs.

Mechanical Turk
One of the best ways to understand Amazon Mechanical Turk is to complete a HIT and see what the experience is like.

Simple Storage Service
Amazon S3 is storage for the Internet. It is designed to make web-scale computing easier for developers.

Simple Queue Service
Amazon Simple Queue Service offers a reliable, highly scalable hosted queue for storing messages as they travel between computers.

Alexa Thumbnails
All thumbnail images are accessible via web services, using SOAP or REST.

Alexa Top Sites
The Alexa Top Sites web service provides ranked lists of the top sites on the Internet.

Alexa Web Information Service
The Alexa Web Information Service makes Alexa's vast repository of information about the traffic and structure of the web available to developers.

Alexa Web Search
The Alexa Web Search web service offers programmatic access to Alexa's web search engine.

« Amazon DevCon - Chris Hofmann | Main | Amazon DevCon - Guido van Rossum »

Amazon DevCon - Gavin King

Gavin King leads the Hibernate project at JBoss. Gavin said he planned to talk about EJB 3.0. It's conceptually similar to what has been in Hibernate 1.0 and 2.0 for quite a while. Gavin told us that he would segue from EJB 3.0 into talking about Hibernate 3.0.

EJB 3.0

Motivation for EJB 3.0: Simplified programming model (make middleware continue to be successful as a line of porducts - simplified APIs or no APIs at all). EJB 2.1 is too "noisy" (too much code was required to make container happy; slower to write, maintain, and understand). Metadata is XML hell (it was code itself and wasn't easily maintained). Simplify testability - unit testing and automation, test suites that are run frequently (hundreds of times a day). Simplified application architecture. Simplify modeling by giving you a richer language to work with (domain object modeling). Simplify querying by making the query language more powerful (EJBQL required many workarounds if you wanted to do anything interesting. You had to break out of EJB model).

Entity beans in EJB 3

- Plain Java Objects: no required interfaces/inheritance, all public methods are non-final, all instance variables are private, non-abstract persistent properties, etc.
- Metadata is as important: Mapped as annotations. Changes more often when you're maintaining a domain model. There are two levels of annotations: logical level and schema level.

Gavin showed some code for creating an entity bean. He said some people think annotations are really ugly and don't like seeing SQL stuff embedded in code. Gavin said annotations will soon be created automatically.

You can just instantiate entities since they're plain objects.

No more home interface ("detyped 'home' interface"), but home interfaces can be useful for running queries and creating objects. They had to replace it with something. The new operator instantiates an entity. Managed entities are associated with an EntityManager. New entities become managed by calling create(). Entities become detached when a persistence context ends. The state of detached entities may be reused in a new persistence context using merge(). This provides true support for optimistic transactions.

EntityManager API

Nice to make a typed interface that isolates business-specific stuff.

Query API

Queries can be expressed as EJBQL strings. Can be invoked via the Query API.

Query Language

EJBQL 3.0 is very similar to HQL (Hibernate Query Language). Aggregation, projection, fetching, subselects. Minimal changing to standard SQL to make it object-oriented. Definition of what data I'm interested in -- what data do I need in this transaction? This is how one problem between object-relational (O/R) mismatch is addressed.

What more is coming? Session beans, interceptors and callback listeners, native SQL query support, XML-based O/R mapping (this will be an alternative if you don't like annotations).

Hibernate 3.0

Hibernate has been around for three years. 3.0 is a major revision of Hibernate implementation and APIs. Migration from 2.X is straightforward, but it's not a drop-in replacement. 3.0 fixes several limitations.

Hibernate 3.0 forms the core implementation of JBoss EntityManager (EJB 3.0 - preview is available now). Going live in a month.

Coolest new feature is filters. The motivation behind filters is looking at temporal, permissioned, and regional data. Global, parameterized restriction on the data. Doing this in SQL is difficult. Filter conditions may be defined as SQL fragments in a mapping document, and they may be applied cumulatively. Filters offer a simple declarative mechanism for handling messy queries.

Filters are defined in mapping metadata. You can define what the filter means for a particular entity. The filter is then injected into any join conditions and where clauses for that entity. Filters are applied transparently when query runs.

Handwritten SQL support. This is an improved feature in Hibernate 3.0. Motivation is that writing SQL is tedious and generated SQL is a good thing. You can bind SQL queries to managed persistent objects.

Gavin showed some code samples to show this in action.

More new Hibernate 3.0 features:

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/t/trackback/183837/1701814

Listed below are links to weblogs that reference Amazon DevCon - Gavin King:

Comments

Post a comment

Comments are moderated, and will not appear on this weblog until the author has approved them.

If you have a TypeKey or TypePad account, please Sign In

July 2008

Sun Mon Tue Wed Thu Fri Sat
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31