Monday, October 20, 2008
Great Erlang podcast with Joe Armstrong
For those who've never heard it before, SER is a series of podcasts on all sorts of interesting topics. The URL is here:
http://www.se-radio.net/
Joe's interview is #89. Happy listening!
Rick
Thursday, October 16, 2008
Tech update-- New Tools in practice
Here's an update on some lessons learned:
ELT (Doing transformations in the database instead of marshalling data in and out) is working out well. It really does save lots of time and makes the whole process more reliable.
Message oriented middleware (through Apache's ActiveMQ) is working out nicely. I really like using the 'Competing Consumer' model to scale services horizontally. Just have your service nodes read from a single queue, add more services to add more horsepower!
Mule has allowed us to easily switch back and forth between desktop and distributed modes. This helps a lot in development. Note that we still have some sore spots-- our database isn't one that lends itself to 'one per developer', so we development and testing isn't as easy as we'd like in that respect.
Automated unit testing is great. There are some parts of the application (especially those around external data sources) that aren't so easy to test. There are various techniques (i.e. dbunit, mock objects) that can be of use, but they all seem a little cumbersome. We need a better answer here.
Agile development has worked out well. This was a first exposure to rapid iterative development for some team members, so it was a bit of a slow start for some of us. Not everybody is convinced yet-- some of our developers like more complete specs before starting their work. I like it, though.
That's it for today!
Tuesday, May 27, 2008
Book Review: Java EE 5 Development using GlassFish Application Server by David R. Heffelfinger
Chapter 9 was EJBs. All the types are covered, as well as transactions, security, the bean lifecycle, and authentication of a client. If anyone’s studying for the Sun Certified Enterprise Architect exam, this chapter could be of use.
Web Services were covered next. It was in this chapter that I had the thought “Wow, Sun really gets ease-of-use!” Whipping up web services with GlassFish is so easy it’s laughable, especially when using NetBeans. (By this time I was so wrapped up in running samples of things that I started using NetBeans, something I do from time to time if I’m working on a Swing UI. This time around I was picking it up to make use of the excellent IDE/Application Server integration. The build cycle, complete with free build scripts, are really handy.) After reading this chapter, I realized my only remaining gripe against GlassFish was use of the command-line interface, which I credited to my own lack of practice. This app server is for real, and given the simplicity of use I have to expect it’s going to be gaining marketshare. Back to the chapter review, we were shown how to quickly produce web services and clients to consume them, all very easily.
Next up was a chapter on technologies complimentary to but outside JEE, including Facelets, Ajax4jsf, and Seam. By this time I was anticipating the result-- another chapter that lent me confidence that all of these were within a few hour’s reach if ever I needed to get started. This is no small feat, considering I don’t consider myself a client-UI coder in the least, at least not for now.
The book includes two appendices that tell how to configure GlassFish for email and how to get started using either NetBeans or Eclipse.
My overall impression of this book is extremely favorable. I’m an IT generalist, which means I’m called upon to work all over the JEE stack, but more often in some places than others. With a book like this on the shelf, I’ll never have to worry about getting blindsided by a request to work on some part of JEE that I haven’t visited for a while. Kudos to the author and to Packt publishing—this book has earned a spot on my bookshelf.
Tuesday, February 26, 2008
Great new book for ESB users
In an unusual twist, the authors of this book presented ESB best practices and techniques using *two* open source ESBs, Mule and ServiceMix. I'm already a Mule user, so I was pretty happy to see several new ideas to employ in my Mule use. I haven't tried ServiceMix yet, but may someday, time allowing. (I'm confident I can run several scenarios right out of the box, armed with this book.) The authors cover more than a few patterns straight out of "Patterns of Enterprise Integration". Kudos to Manning for allowing their authors to acknowledge this excellent resource, even if it comes from a different publisher. I really do appreciate that!
I liked several ideas I think I'll apply somewhere down the line-- including use of XML on Mule to facilitate validation and transformation, use of JibX to help make object-to-XML transformations, and use of a BPM product to oversee non-integration parts of my ESB. (I suspect that'll de-tangle the configuration a great deal, or at least make it easier to understand.)
By using two ESBs to implement every use case, I think the authors give you some insights you might otherwise have missed if you saw just one side of the story. As I said previously, unusual, but interesting.
I won't go on and on-- let's just suffice it to say this book will have a spot on my bookshelf when it becomes available in the near future. If you use an ESB, or think you might like to, you might consider looking at this informative work.
Wednesday, February 20, 2008
If it ain't got "Hello World", and it ain't got a cookbook...
Case in point-- the ESB market. Near as I can tell, Mule is running away with that game, largely because of it's ease-of-use model. Anyone reading the help docs can run about a half dozen excellent example configurations not long after downloading Mule. Compare that to some of the other ESBs out there-- they may or may not be able to compete on other merits, but they may never get the chance because they don't get a second look the initial few hours of frustration. Another exception is anything with enough critical mass that it's on everybody's short list sight unseen.)
Examples of doing it right:
Hibernate
Tomcat
Terracotta
Examples of not doing it right:
JBoss WS
Jess
Spring Batch
I'd love to see some of those 'not right' projects do better (especially Spring Batch). Let's see how they fare in the long run-- check back in a year or so.
Sunday, February 17, 2008
The Rules and Data shortcut-- doing things the ELT way
An idea has emerged, though, that might help us in many ways. If we resort to doing 'ELT' processing (Extract, Load, Transform-- *not* ETL), we can use the database to do our heavy lifting for us. A really great side-benefit is that we can do this with a small number of SQL statements instead of a whole bunch of data access classes and a bunch of business rules. We also get benefit of having the database state much less vulnerable to partially successful operations, as the SQL can easily be made transactional.
Here's a quick 'method 1 vs. method 2' comparison:
Method 1:
Determine what kind of data the rules require.
Pull the data (using Hibernate generated DAOs), put it in Working Memory.
Fire the Rules (which have to know the particulars of the Entity objects).
Put the rule results back in the database.
*Note: The data is 'pulled out' of the db, then the results are 'put back in'.
Method 2:
Using temporary tables and SQL, do as much of the rule work as possible in the database.
Do simple calculations, putting results in temporary tables that are created and destroyed as often as needed. Make small jumps in state from 'step' to 'step'. This will make more SQL, but simpler SQL.
After an 'End state' temp table is populated with the results of the rule evaluation, put the rule results back in the database. (In this case, an update OR insert, depending if we already had a result for some of the Entities under evaluation.) Some databases (including MySQL) give you convenience functions to handle inserts (if no row with this key) or update (if key exists).
*Note: The data never 'leaves' the database. The database doesn't necessarily work any harder (because it's doing fewer compute-sensitive large joins, selects, etc.) instead of a whole lot more run-of-the-mill DAO operations (gets).
Since the db is doing all the work, all we need is a single client to make the SQL requests instead of an army of distributed clients in Scenario #1. This makes for much simpler recovery and restart in the event something goes wrong (and fewer machines and instructions working, so fewer opportunities for things to go wrong.)
I'm much more of an application developer than a DBA, so this logic-in-SQL idea is not my first choice, but I think I like this ELT stuff. I'll just have to be careful to keep the SQL as simple as possible, as this seems to be the strongest negative that I can find in this situation.
Thursday, January 3, 2008
Welcome to my blog!
For starters, I'll let you know what's on my mind today:
- Building dynamic queries can be tricky. I'm trying to build an application that will pull data from different tables and columns based on records in an input file. If the input file has a record for George Washington, I may have to go pull data from the GeneralsTbl and the PresidentsTbl. If the input file has a record for George Curious, I may have to go pull from the PrimatesTbl and the CartoonsTbl. I'm in need of some sort of MetaData facility, but am not sure what quite yet.
- Once I have my data gathered, I have to present it to a rules engine. (I'm using JBoss' Drools, which I like very much.) We need the rules and the data to be flexible (i.e. the GeneralsTbl might not be available tomorrow, but we might have a new one, MilitaryPersonnelTbl, to pull from). I think I can get away with using lists (and some handy reserved words Drools gives us to use collections), but will want to be careful. Writing the rules templates to enable plain-speak rules can be difficult, but should pay off if our rules are reasonably stable.
- I'm using the Mule ESB to act as a component model and service framework. Mule allows easy use of Spring, and I think is often used with ActiveMQ as a Messaging provider. I think both Spring and ActiveMQ are starting to feature-creep towards Mule's core business, so it will be interesting to see how things play out in the long run.
That's it for today! In future entries I hope to provide tales of what worked well, what didn't, how obstacles were overcome, etc.
Thanks for reading!
Rick