Showing posts with label java. Show all posts
Showing posts with label java. Show all posts

Thursday, October 9, 2008

Friday, October 3, 2008

Book Review: Harnessing Hibernate

Harnessing Hibernate is the latest in a series of books I got recently to review (I have been a little too busy to read through all of them...). The book caught my interest right away since I have used Hibernate on a pretty big enterprise project a while ago and was involved in the solving of some performance issues faced by another large project due to their mishandling of some Hibernate code.

I like how Hibernate makes building data services a cinch - but more often than not, it worries me that a lot of people don't really understand Hibernate the way they need to before they can use it in large-scale applications with emphasis on scalability and performance. Understanding what goes on under the hood of Hibernate fetches goes a long way in avoiding silly mistakes like loading a set of large, linked objects into the memory when you probably needed just the top-level object or a couple of properties.

Also, a lot of books seem to focus on working code and simple samples - prototypes that work, but are ultimately not much of use in a real-world situation. I consider it a strength of this book that it doesn't take the readers for granted. The authors do a great job of explaining all concepts involved in getting a Hibernate application to run - including build tools like Maven. It has clearly defined examples, possible errors and ways to get around the errors. Of course, that doesn't mean there isn't much here for experienced developers - there are some really neat tips and tricks that might go over the heads of those that are not advanced enough to understand the concepts.

I would recommend this book readily whether you are a beginner looking to learn Hibernate or an advanced devloper hoping to refresh their knowledge or find something they might have missed before.

Thursday, September 18, 2008

Simple steps to create a portlet and consume it in Oracle Webcenter

There is definitely tons of documentation on this topic - I am not going to repeat it all but I thought a super, simple distilled version always helps ;)


  1. In JDeveloper, create a new web application with "portlet, repository, JSF" capabilities. This creates three projects in your application - "Model" (for your data needs), "Portlets" (where your portlets will reside) and "View Controller" (to build your JSF pages and components).
  2. Right-click your Portlets project, pick "New" -> Web Tier -> Standards-based Java portlet (JSR-168) to lauch the wizard. The rest of the wizard steps are pretty self-explanatory and the requisite files are automatically generated for you.
  3. Right-click on your Portlets project to create a new deployment descriptor (New... -> Deployment Descriptor).
  4. Right-click on your brand new *.deploy file created in the "Resources" folder and deploy. Your portlet is now deployed to your app server. Note: Remember to go to the connections tab and create an application server connection that you can deploy your portlet to prior to the deployment.
  5. In your browser window, type http://<host>:<port>/<context-root>/info to see your portlet's deployment status and to get the links to the portlet's WSDL (wsrp 1 and 2 are automatically generated).
  6. From your View Controller project, right-click to register a new WSRP Producer (New.. -> Web Tier -> WSRP Producer Registration). The URL endpoint to use here is the url of the WSDL from step 5 - either WSRP1 or WSRP2, based on the standard you are using. You will now see the newly registered portlet producer in the Portlet Producer folder in your application. 
  7. Create a new JSF *.jspx page using New...->Web-Tier->JSF page wizard.
  8. If you haven't already, right-click on the View Controller project and in the project properties, add the Customizable Core Components library to the project to have this show up in your component palette.
  9. Drag and drop the "PanelCustomizable" component within the h:form already on the page. Find the portlet producer you just registered in the component palette, pick your portlet in it and drop it within the PanelCustomizable on the JSF page. Note: If you don't find the portlet producer in the palette, make sure you created it from within the project. 
  10. Run the JSF page by right-clicking on it selecting "Run". You can see your portlet being consumed by the JSF page :)

Monday, September 15, 2008

Usability and JDeveloper

Alright, I agree I might not be working with all my brain after a nice and heavy meal of eggplant parmigiana, but Oracle's JDeveloper is not epitome of usability in my experience. This is the first time I have used this IDE (I still "heart" Eclipse!). I am only using it since it integrates well with the Oracle Fusion Middleware and that is my new mission in life to get well-versed in.

As a simple first step (after the not-so simple step of installing Oracle's SOA Suite), I am trying to create a portlet based out of the Oracle WebCenter framework. I relied on the cuecards to lead me through the process. Of course, the second step on the cuecard is to launch the Oracle PDK-Java Portlet Wizard - without explaining how to do so. I had to go to the "Show Me" menu on the cuecards to launch a browser window and an Oracle "viewlet" that actually visually showed me how to launch the wizard - a three-step process in itself.


Not to put the product down or anything, but figuring out how to launch a wizard should really not be rocket science!

Thursday, August 28, 2008

Wonderland - Virtual World Toolkit from Sun

Here is another interesting link passed on from a friend (thanks, Roger!) - Project Wonderland - Toolkit for building Virtual Worlds. Seems like a cool new java-based toy for the desktop that lets users create interactive 3D virtual worlds like Second Life for themselves. There is no license fees to pay - the platform is available under the GNU GPL v2.0, though commercial customers might want to look into the dual license.

Interesting as the project may sound, questions abound about how useful this is if it is going to be just a few developers creating things on their own servers - even if a few of them manage to link up. The beauty of virtual worlds is the ability to be physically be in one corner of the world while you are interacting virtually with people all over the world. The more people you see around and the more content you let them generate and play with, the more likely users of the world are going to last.

It is the being linked in to other people that allows virtual worlds flourish - not just the virtual part. It will be interesting to see how this effort fares outside of a purely educational experience.