- 5 Reasons Why Administrators Will Love Confluence 3.5 – Over the past few months the Confluence Development Team has been hard at work on a number of exciting new features coming to you very soon with the upcoming release of Confluence 3.5
- Getting started with Spring Data JPA | SpringSource Team Blog – As we have just released the first milestone of the Spring Data JPA project I’d like to give you a quick introduction into its features
- What Programming Language to Learn (Next) – So you’re ready to learn a new programming language? You might be entirely new to the world of application development, in that case, welcome!
- Java EE Productivity Report 2011 | ZeroTurnaround.com – What happens when over 1000 Java developers compare their development environments?
- Setting up Contracts for Java in Eclipse « Geschreibsel – On Friday, Contracts for Java was announced on the Google Open Source Blog. Learning about this at the beginning of the weekend was perfect timing for me: I had time to check it out, and while setting it up was some work, I was hooked right away.
- Nokia Said to Be Near Software Partnership With Microsoft – Businessweek – Nokia Oyj is close to announcing a software partnership with Microsoft Corp., a bet that together the two companies can better challenge Google Inc. and Apple
- Daring Fireball: The Next Six Months – The iPad and iPhone have more market potential than any products Apple has ever released. They have the chance to be both the Microsoft and the Intel of the next generation of personal computing — profiting, wildly, both as the software platform vendor and hardware seller
- HTML5 Is An Oncoming Train, But Native App Development Is An Oncoming Rocket Ship – If HTML5 is an oncoming train, native app development is an oncoming rocket ship. And everyone seems to know that’s not going to change anytime soon. Even if they don’t want to admit it, their native apps speak for them.
- hibernate-generic-dao – Generic DAO implementation: extendable, detailed search, remote service interface – The purpose of this framework is to save the time, tedium and possible inconsistency of hand coding DAO layer objects. This includes all of the basic CRUD methods as well as various "find" or "search" methods.
- Advise the Advisor | The White House – Advise the Advisor is a new program to help senior staff at the White House stay connected to the American people. Think of this as your direct line to the some of the President's senior advisors at the White House.
Tag Archives: DAO
Daily del.icio.us for September 9th through September 16th
- SpriteMe: Spriting made easy – SpriteMe is an open source project that helps web developers create sprites in a matter of minutes rather than hours.
- InfoQ: Book Review: Understanding SCA – Overall the book provides a complete introduction to SCA. If you are not familiar with the technology and you are building an SOA, it is certainly worth investing some of your time either to adopt the technology or implement some of its patterns.
- Feds launch Apps.gov; Cloud computing players salivate | Between the Lines | ZDNet.com – The Federal government launched Apps.gov, a site designed to be a storefront for approved cloud computing applications. The move is designed to streamline application adoption at federal agencies
- Introduction to Google Collections | Benjamin Winterberg – The Google Collections Library 1.0 is a set of new collection types, implementations and related goodness for Java 5 and higher, brought to you by Google. It is a natural extension of the Java Collections Framework you already know and love.
- InfoQ: 3 Patterns from SOA Design Patterns by Thomas Erl – All of these patterns are considered fundamental to inventory governance in that they support and are influenced by the Service Discoverability principle, which actually shapes service meta information in such a manner that it can be effectively discovered and interpreted.
- SproutCore 1.0 is almost ready – After 20,000 lines of new code, over 5,000 new unit tests, and countless hours of effort by over 30 contributors, SproutCore 1.0 is almost ready. Try out the new code today and help us make the push to our final release. Join the HTML5 revolution.
- iPhone gets .Net app development | Developer World – InfoWorld – Leveraging Novell's Mono runtime for running Windows applications on non-Windows systems, Novell's MonoTouch 1.0 is a commercial software development kit that lets developers utilize code and libraries written for .Net and programming languages like C#
- thewojogroup’s simplecart-js at master – GitHub – A simple paypal shopping cart in 20kb that you can setup in minutes
- Hades – Trac – Hades is a utility library to work with Data Access Objects implemented with Spring and JPA. The main goal is to ease the development and operation of a data access layer in applications.
Daily del.icio.us for July 22nd through July 26th
- PCQuest : Developer : Auto Tweet on Twitter Using Java – Twitter4J is a Java library for Twitter API, using which you can communicate with Twitter directly through your Java application
- Principles for Implementing a Service-Oriented Enterprise Architecture | SOA Zone – Implementation of this SOEA is likely to be, and probably should be, incremental. More progress needs to be made at the development level. Organizations need to develop the implementation, governance and configuration management aspects of an SOEA methodolog
- Ibatis Tutorial: Inheritance Strategies ~ C for Coding – I believe that Ibatis really is on the "sweet spot" of complexity vs capability for persistence frameworks, offering most of the (useful) features of JPA with significantly less complexity. This tutorial is another in the series that I hope will demonstrate that.
- Justin Gardner – Political Pulse – The Legalized Theft That Is High Frequency Trading – True/Slant – Nearly everyone on Wall Street is wondering how hedge funds and large banks like Goldman Sachs are making so much money so soon after the financial system nearly collapsed. High-frequency trading is one answer.
- Adam Bien – press.adam-bien.com – This pragmatic book offers the real world knowledge and code you need to develop lean but still maintainable Java EE 5 / 6 applications. Real World Java EE Patterns – Rethinking Best Practices guides you to efficient patterns and best practices in a structured way, with real world code
- JPA Implementation Patterns: Saving (Detached) Entities | Javalobby – When switching from Hibernate to JPA a lot of people are dismayed to find that method missing. The closest alternative seems to be the EntityManager.merge method, but there is a big difference that has important implications. The Session.saveOrUpdate method, and its cousin Session.update, attach the passed entity to the persistence context while EntityManager.merge method copies the state of the passed object to the persistent entity with the same identifier and then return a reference to that persistent entity.
- Making the Good Programmer … Better | Javalobby – If there's one point that you can take away and implement from this article it's this one. Take pride in what you do. Everything else falls into place, and you will become a great programmer if you take this advice
- Apple has 91% of market for $1,000+ PCs, says NPD | Betanews – Move over Microsoft. Apple can claim big, big market share numbers, too. According to NPD, in June, nine out of 10 dollars spent on computers costing $1,000 or more went to Apple. Mac revenue market share in the "premium" price segment was 91 percent, up from 88 percent in May
- Ted Husted – Embrace Your Inner Google – A few years back, when I first tried IntelliJ IDEA's refactoring tools, I felt like I was pair programming with Commander Data. In the background, IDEA would compile my code, correct my syntax, and suggest fixes when my programming got sloppy. IDEA helped me write better code in less time.
- JPA Implementation Patterns: Data Access Objects | Javalobby – The abstraction provided by JPA is pretty leaky and has ramifications for larger parts of your application than just your Data Access Objects (DAO's) and your domain objects. You need to make decisions on how to handle transactions, lazy loading, detached object (think web frameworks), inheritance, and more. And it turns out that the books and the articles don't really help you here.
Daily del.icio.us for February 23rd through February 25th
- The Rise and Fall of Dynamic Languages | Ruby Zone – In this interview, Ruby programmer and consultant Rick DeNatale provides his perspective on the fall and rise of dynamic languages, including Smalltalk and Ruby. Rick#039;s work through the years has given him a unique and low-level perspective of what works and why.
- DRY CRUD DAOs with iBatis – Gregg Bolinger – I blogged before about writing DRY CRUD DAOs using JPA. I was able to improve on that thanks to many comments from other users. So thanks for the tips. On a recent project we decided to go with iBatis and I wanted to see if it was possible to use the same methods that I use for JPA based DAOs.
- 12 CSS Tools and Tutorials for Beautiful Web Typography | Web Design Ledger – Achieving beautiful typography with CSS on the web is no easy feat, and there are many limitations to what can done with type on the web. However, there are generous people out there that have taken the time to build tools and write tutorials to help you overcome these limitations and create websites with beautiful typography.
- Strategies – The Index Funds Win Again – NYTimes.com – THERE’S yet more evidence that it makes sense to invest in simple, plain-vanilla index funds, whose low fees often lead to better net returns than hedge funds and actively managed mutual funds with more impressive performance numbers.
- Red Hat debuts virtualization software – Red Hat Inc. today introduced an entire line of virtualization software aimed at disrupting current market leader VMware Inc.#039;s position by giving customers an open-source option for virtualizing their data centers.
- State of the Art – Amazon.com’s Kindle Goes From Good to Better – NYTimes.com – With those caveats, the new Kindle edges even closer to the ideal of an e-book reader. The reading experience is immersive, natural and pleasant; the book catalog, while not yet complete, is growing and delivered instantaneously; and apart from the clicky keyboard (an unnecessary appendage 99.9 percent of the time), the design feels right.
- Citrix to offer free XenServer; Takes shot at VMware | Between the Lines | ZDNet.com – Citrix on Feb. 23 will detail plans to offer free licenses to its XenServer virtualization application and team with Microsoft to swap support. Citrix and Microsoft will also extend their 20-year partnership into the virtualization market.
In a nutshell, Citrix will work with Microsoft to provide system management, Citrix Essentials for Hyper-V. Microsoft’s System Center will support XenServer.
- It’s official: Citrix aims to blow up enterprise virtualization pricing | Between the Lines | ZDNet.com – Citrix officially launched a free version of its XenServer and Essentials virtualization software in a move that is designed to take aim at VMware. Separately, Citrix extended its long-running partnership with Microsoft to cover virtualization.
- 9 Must-Try Adobe AIR Apps for Better Productivity – With this new age of “application neutrality,” I wanted to take a brief look into some Adobe AIR apps you have to at least try. Each one is focused on increasing an area of productivity.
- Application Development Trends – Sun Expands GlassFish into Web Platform – Sun Microsystems last week announced a new bundle of open source projects assembled around the GlassFish application server to create a quot;high-performance Web platform.quot;
- Wikis and Wall Street: A Perfect Match? – By focusing on improving productivity and supporting mission-critical apps (but not touching customer and transaction data), wikis can be used to deliver major ROI without requiring integration with legacy systems or storing customer data outside the firewall.
Daily del.icio.us for May 20th through May 24th
- Computing | Down on the server farm | Economist.com – One day soon, these “virtual machines” may migrate to wherever computing power is cheapest, or energy is greenest. Then computing will have become a true utility—and it will no longer be apt to talk of computing clouds, so much as of a computing atm
- InfoQ: Integrate Flex with Spring Framework – A key to project success is creating an architecture that new developers can rapidly integrate themselves into and begin to be productive on day 1. Flex with Spring, iBATIS, & Cairngorm help me to quickly produce a patterned- based, repeatable architectur
- New Adventures in Software » Visual SourceSafe: A Public Service Announcement – “Visual SourceSafe? It would be safer to print out all your code, run it through a shredder, and set it on fire.” – (Attributed to an unidentified Microsoft employee).
- SSIS Junkie : SSIS: Suggested Best Practices and naming conventions – I thought it would be worth publishing a list of guidelines that I see as SSIS development best practices. These are my own opinions and are based upon my experience of using SSIS over the past 18 months. I am not saying you should take them as gospel but
- IntelliJ IDEA Blog » Blog Archive » Neal Ford Advises on Boosting Developer’s Productivity – Neal tells you how you can become more accustomed with the shortcuts, get used to using them in the daily routine, and demonstrates the magic of different key combinations while coding with IntelliJ IDEA.
- Twitter Technology Blog: Twittering About Architecture – Twitter is, fundamentally, a messaging system. Twitter was not architected as a messaging system, however. For expediency's sake, Twitter was built with technologies and practices that are more appropriate to a content management system
- Enterprise Java Community: Extending Spring LDAP with an iBATIS-style XML Data Mapper – This article explains how to extend Spring-LDAP with an iBATIS-style XML Data Mapper to access LDAP data through intuitive JavaBean operations.
- About – XML Hammer – The XML Hammer application is a free and open-source tool that simplifies elementary XML actions like checking for well-formedness, validation, transformation and xpath searches using any JAXP implementation.
- Novell, Red Hat upgrade Linux offerings – LinuxWorld – Novell released SUSE Linux Enterprise 10 Service Pack 2 (SP2), while Red Hat shipped Version 5.2 of Red Hat Enterprise Linux. Both vendors added improvements on the desktop and the server. There were many areas of overlap, especially with virtualization.
- JasperReports: 3.0.0 released – JasperReports, the market leading open source business intelligence and reporting engine. This project is being moved to http://www.jasperforge.org/. This project is the home for all things Jasper, Reports, Analysis, Server, and Intelligence.
iBATIS – Where have you been all my life!
iBATIS SQL Maps is an open-source JDBC framework that provides a very simple and flexible means of moving data between your Java objects and a relational database. The SQL Maps framework helps reduce the amount of Java/JDBC code that is needed to access a relational database. The framework allows you to map JavaBeans to SQL statements using a very simple XML descriptor that allows you to create complex queries, and inner/outer joins. The beauty of it all is that this is achieved without any special database tables, bytecode manipulation, or code generation.
iBATIS is not meant to replace Object-Relational Mapping (ORM) tools such as Hibernate, OJB, Entity beans or TopLink to name a few. Rather it is a low-level framework that allows you to directly hand-code your SQL statements and map them to Java object. Once you map your persistence layer to your object model, you are all set. You don’t need to lookup DataSource, get connections, create prepared statements, parse ResultSet or even cache the results – iBATIS does it all for you. Under the covers, iBATIS creates a PreparedStatement, sets the parameters (if any), executes the statements and builds a Map or JavaBean object from the ResultSet. If the SQL statement was an insert or an update, the numbers of rows affected by the SQL are returned. Here’s a little sample to illustrate the features of iBATIS: We’ll start with a simple database that ships with the JpetStore application from iBATIS.
First you configure SQL Maps by creating a XML configuration file, which provides configuration details for DataSources, SQL Maps and other options like thread management. Here is a simple example of the SQL Map configuration file:
In my case, I am deploying this code in WebLogic and I have already created a connection pool and a datasource on the WebLogic side. I am just referring to the name of the datasource by using
jdbc/jpetstoreDS. You can also create your own datasource via. the SQL Map configuration file:
The SQL Map configuration file includes a reference to another SQL Map file that contains your SQL statements for insert, update, delete as well as results and parameter mapping. Here is a simple example of the file Account.xml:
Account.xml SQL Map file is pretty self-explanatory — In the file, we are describing a select statement that takes an Integer as it’s argument and returns an instance of com.j2eegeek.ibatis.domain.Account. Insert, updates, deletes work the same way along with stored procedures and dynamic queries. The programming API for SQL Maps is really straightforward and provides the developer with the ability to: configure an SQL Map, execute an SQL update (including insert and delete), execute a query for a single object, and execute a query for a list of objects.
A pretty simple example but it should illustrate the simplicity of iBATIS SQL Maps and show you the potential of this framework. SQL Maps takes away all of the work required to create Statements, validate and parse inputs, create and parse ResultSets and all of the nitty-gritty details of working with SQL by hand. Instead, you are working at the object level and not really worrying about how your data is stored or retrieved. I’ve found that this also enables a good separation of work where your ‘data-guy’ can create up the appropriate SQL statements for you and you just plug them in, assuming you have a ‘data-guy’. I’ve found that SQL Maps really helps me in my development process (In most cases, I am working with existing databases) as I spend time looking at the data-model as part of my overall design process and will typically mock-up the SQL statements I am going to use to manipulate the data at hand. Now I can just take my SQL statements and plug them into the SQL Map XML files and half my app is already built.
iBATIS SQL Maps is really powerful and you can take this one step further by using Spring’s DAO framework in conjunction with iBATIS. Using Spring’s DAO framework and the iBATIS template classes provided by Spring, you will write even less code that you would have normally written using iBATIS by itself.
Book Review: Expert One-on-One J2EE Development without EJB
Expert One-on-One J2EE Development without EJB by Rod Johnson, Juergen Hoeller
Paperback: 576 pages
Publisher: Wrox (June 21, 2004)
I’ve read this book several times since the day it shipped and I have to say that this is an excellent book for anyone working as a developer or architect working in the Enterprise Java arena. I absolutely love this book given my bias – I guess I should start by stating my bias. EJB bashing is a favorite past time of a lot of people. I happen to love EJB’s, with the exception of entity beans and think EJB’s are a great way to create software solutions are remotable, loosely coupled and powerful. I will agree that EJB’s are way too complicated with all the stupid artifacts that you need to create to create and deploy an EJB. Having worked with EJB’s since 1999, I guess I am so used to all of nuances of EJB’s, I can write up deployment descriptors in my sleep. Having said that, I approached this book with a little apprehension as I hate these EJB-sucks book that don’t really offer any intelligent discussion about the shortcomings of EJB nor do they offer a viable alternative. Another assumption I brought to the book was that this was just a Spring book with a little EJB bashing thrown in for good measure.
To my pleasant surprise, Rod Johnson and Juergen Hoeller have written an awesome book. This book does not take cheap shots – Instead there is a intelligent, thought provoking discussion about the pros and cons of EJB. In fact, the first 120 pages (Chapter 1-5) are just a great breakdown of application architecture with a through treatment of EJB. I loved this section and re-read it several times and I found myself agreeing with pretty much everything in this section. I would equate this to a great meaningful discussion you would have with someone who really understood application architecture and development and you could debate the pros and cons of the many alternative approaches that exist today.
Chapter 6 starts the discussion of Lightweight Containers and the idea of Inversion of Control (IoC). This is not a chapter on Spring; rather it is an overview of Inversion of Control and strategies like Dependency Injection in the context of Spring and PicoContainer.
The next chapter offers a quick introduction to the Spring Framework. As everyone already knows, the Spring Framework is a very popular open source application framework created by Rod Johnson. The co-author Juergen Hoeller is another lead developer of Spring. The chapter is Spring is fairly light and people hoping for a in-depth Spring tutorial will be disappointed. Instead this chapter offers a rather high-level overview that will get you some basic understanding of the Spring Framework. I guess it’s hard to cover Spring in 43 pages.
After the cursory introduction to Spring, the book moves into Aspect-Orientated programming (AOP) concepts. This section starts with a very introduction to AOP before jumping into AOP implementation strategies. After a brief discussion of AspectJ, AspectWerkz, and JBoss AOP, the authors move into SpringAOP. After AOP, the books moves into Transaction Management where current J2EE approaches are discussed and then contrasted with the Spring approach.
Persistence is the next item tackled in the book and this section includes a really nice discussion of why you need a persistence strategy, when to choose O/R mapping vs. straight JDBC. After a walkthrough of the Java persistence technologies, the book moves into practical items and discusses Persistence in detail. Starting with JDBC, the authors contrast that approach with iBATIS SQL Maps, JDO, and Hibernate. The section on Data Access Object (DAO) pattern discusses the J2EE pattern and discusses some of the common design issues faced by developers. After the discussion, the book moves into discussing how data access works with the Spring framework and discusses Spring’s DAO framework and how it works transparently with persistence technologies including iBATIS, Hibernate, JDO and straight JDBC. As an aside, if you haven’t looked at Spring or just it’s DAO framework, you should explore it as it simplifies the development process and minimizes the amount of code you write. I just rewrote some of my POC applications using Spring’s DAO framework that used iBATIS and Hibernate under the covers. By using the template classes provided by Spring, I wrote about 30-40% of the code I would have normally written using iBATIS or Hibernate by themselves. The Spring Framework includes a reworked version of the original JPetStore application that uses Spring’s DAO framework along with iBATIS SQL Maps.
After persistence, the book moves to Remoting and the idea of exposing business logic or services to remote client. One of the major benefits of EJB is the ability to remote anything exposed at the bean layer. This chapter starts off by discussing how to access an EJB from a Spring application using the JndiObjectFactoryBean. The setup is so simple and IoC makes lookup, creation of home, etc so easy with the declarative configuration. After EJB, the chapter moves to Web Services and JAX-RPC. Again the authors walk through the steps needed to consume JAX-RPC via. JNDI and demonstrate the elegance and simplicity with which Spring integrates into and consumes existing J2EE services. This chapter also includes discussion of Hessian and Burlap and the concept of lightweight remoting.
The next chapter in the book discusses the other EJB services that the container provides and talks about how to replace them. This section breaks down the do’s and don’ts in terms of threading and pooling that is typically provided by an EJB container. There is a brief mention of security in this chapter.
The next section of the book discusses web tier design and dives into the current state of Web Model2 MVC frameworks. The section starts off with a look at Struts before jumping into WebWork. After the intros, the authors describe the Web MVC framework built into Spring. One of the things that I absolutely love about this book is the use of the dark gray boxes to summarize a topic, offer tips and advice or offer a best practice.
The next chapter is one of my favorite chapters in this book and it deals with the idea of unit testing and testability. Anyone that has written a J2EE application will attest to the fact that J2EE apps are really hard to test. There are a lot of testing frameworks in the market now but they require either too much setup or are really cumbersome to use and end up diluting the value they were supposed to offer. This section discusses some of the anti-patterns that are the de-facto standards in J2EE. I love the techniques offered in this section to improve testability. After an overview of testing, the book moves into a discussion of Mock Objects and the how, why and when of using Mock Objects in your development/testing lifecycle. The book then moves into Test-driven development (TDD) and offers a case study of how TDD has helped with the development of the Spring framework itself.
The last section before the sample application is on performance and scalability. This is another great chapter that should be mandatory reading for every developer. In this chapter, the authors discuss the challenges faced in building distributed multi-tier applications. There is a section that breaks down the architectural tiers and some of the common issues faced by every application developer. Very nicely written chapter and I glad the authors included a section on Profiling.
After performance, the book jumps into the sample JPetStore application that ships with the Spring Framework. The authors start off by discussing some of the shortcomings on the JPetStore application and then employ Spring to solve some of those issues. The JPetStore application is a great tutorial application for anyone learning Spring.
The book closes out with the conclusion section where the authors wrap-up and summarize some of their points outlined throughout the book.
Having read this book several times, I have to say that this has to be one of my favorite books of 2004. I love the clear, concise writing style of the authors. This is a great book and a must for every developer’s library. While this is not a Spring tutorial book, you will learn enough about Spring to want more, a lot more. I highly recommend this book and encourage you to run to your local bookstore or computer and get this book.
If you are looking for a Spring book from the source, you’ll have to wait for Rod’s new book entitled Professional Java Development with the Spring Framework co-authored with Juergen Hoeller, Alef Arendsen, Thomas Risberg, Dmitriy Kopylenko or wait for Keith Donald’s Spring book.