This post originated from an RSS feed registered with Java Buzz
by Scott Delap.
Original Post: Core Data and Java
Feed Title: ClientJava.com
Feed URL: http://www.clientjava.com/archives/wireless_mobile.rdf
Feed Description: Client/Desktop Related Java Development
I did some brief research into Apple's Core Data additions to OS X Tiger yesterday. My interest was first spurred by Dion's blog entry.
Dion: Core Data - Room for a Java port? Apple keeps on trying to make it easy for developers to develop top quality applications. In Tiger they are introducing Core Data, which is a managed object model. Basically it gives Cocoa a nice simple way to develop a model that doesn't just map to some database. Core Data lets you create an ERD with Interface Builder, which acts as a model...
Then I looked at the Apple developer article.
Apple: Developing with Core Data Core Data, new in Tiger, completes the Cocoa vision for building well-factored applications based on the Model-View-Controller (MVC) pattern by providing a strong, flexible, and powerful data model framework...The technically correct way to describe Core Data is as an object-graph management and persistence framework. In down-to-earth terms, this means that Core Data organizes the application's model layer into a set of defined in-memory data objects...However, make no mistake, Core Data is not an object-relational database access framework. Instead, it uses concepts from the database world to take application data management to a new level. It provides a general-purpose data management solution developed to handle the data model needs of every kind of application, large or small.
We've mentioned that you can use Cocoa bindings to connect a Core Data managed object context to your application's user interface. However, early in an application's development life cycle when you are exploring what kinds of objects you need to capture in the data model, you can take advantage of a new feature of Interface Builder that will create prototype interfaces for you. All you need to do is Option-drag an entity from the Xcode Data Model design tool onto a window in Interface Builder and a comprehensive interface will be created for you.
Apple has a lot of interesting integrated technologies pack into this framework. First you have a variety of persistence options including XML and a SQLite database. Core data also has built in undo/redo support which is always a bear to code manually. General persistence seems very similar to what Hibernate supplies in terms of saving and deleting objects. However, the interesting thing is everything is driven from XCode. You model the objects and relationships and it does the rest. The final feature mentioned that seems really slick is automated UI prototype generate. As the paragraph excerpt above explains, supposedly you can simply drag the model into interface builder and it will create a generic working UI.
Dion wonders about doing something like this with Java. I think a majority of the pieces are already there. They just need to be put together. I seem to remember tools floating around that allow you to model objects and then generate classes and hibernate mappings. Binding solutions such as JGoodies could be used to wire the domain object automatically to a UI. This leaves the creation of a undo/redo framework and prototype UI generation. The whole things almost reminds me of what Rails is trying to pitch in the web app space. I'll definitely have to investigate Core Data more when I upgrade my Powerbook to OS X 10.4.