Sunday, December 10, 2006

Trends and Future of Java

This one is useful for me because I am always wrong about what the next big thing is.
Random notes (I'll clean this up, or delete, later):

AOP vs OOP
OO = nouns and verbs
AO = adverbs and adjectives
Glassbox

POJO triangle:
DI, Aspects, @Annotations

Community returning to OO, POJO (J2EE seemed to be a swing away from OO).

Domain Driven Design
Make the domain reflect real world concepts; focus on the domain. Collaborate with business owners. (isn't this one of the tenets of Agile?)
Domain Specific Languages
Adding domain concepts to the language instead of libraries and frameworks.

Ruby for DSL?
Grails -> Spring/Hibernate/SiteMesh
http://www.infoq.com/grails

JSR-170 Content Repository API for Java
Follow-up 12/12: I've been playing with Apache Jackrabbit (the reference implementation) a little bit since the conference. There is some documenation, though not too much. This is basically a very low level API that a content management system may be built on top of. I'll probably rework my site to use it in the next few days. I'll also publish the results. I get the feeling that some work needs to be done in order to discover the best practices for this.

JPA: Hibernate, OpenJPA, Kodo

permalink
Links to this post
0 comments

... Rule Engines ...

Declarative Programming and rule engines are closer to the way clients think.
True
Users know a solution when they see it. But, they don't necessarily know how to get there.
Given

Facts: represent current state of the system
Rules: represent knowledge
Backward chaining: can prove statements (think symbolic calculator)
    - goal driven reasoning
    - prove a rule is valid
    - does not need facts that are not required for proof

Forward chaining: execute rules (think expert systems)
    - fact driven reasoning
    - executes all rules that can with current facts
    - needs all avail facts

Performance issues may prevent usage of a rule engine in 'live' systems.

In the listing of "when to use a rule engine" he gives a case of:
     - "When you know the constraints of the solution, but now a precise algorithm to reach it."
Could I use genetic programming to extract an algorithm from the rule engine?
     - "When the algorithm is too complex, but a 'good enough' solution is acceptable"
A neural net is provided as a possible alternative here. He also points out the cost/time involved in properly training the net.
     - "When we have to deal with imprecise or incomplete input"
     - "When we suspect the solution will e a chain of exceptions and refinements to a generic rule"

When to avoid?
     - when there is a clear algorithm
     - critical performance
     - if the solution is unlikely to change (hahaha)

Next up, a basic example explaining the how the logic works in a rule engine.
Then a little comparison of Java source with CLIPS.
The example, sorting, is contrived but, its simple enough to get the point across. The normal java is simpler until, special cases are added. This is where the Java becomes more complex and the CLIPS code can stay elegant.

permalink
Links to this post
0 comments

Bright and Early

Covered the Spring and Eclipse RCP session.
This was really more of an OSGi and Equinox kind of thing. Still, very good. I need to write down much more about this but, now its off to "Real World Rules Engines".
w00t! Seems everywhere I go we have to (re)implement a new rule engine. This should be good.

permalink
Links to this post
0 comments

Saturday, December 09, 2006

Finished for the Day

I just finished the "Rapid Fire Session" about building search with Compass.
I am dead tired. Its 11:30.
The session went well. I first, I'm thinking, just use Lucene and get it over with; its not that hard. But, then I saw a little more of what Shay was trying to accomplish with Compass. Its pretty cool how it can sit between the data access layer to keep the search index up to date as data changes.
He also exposes the underlying Lucene API so you can get stupid if you need to. The use of annotations with the system and managing different data types makes a lot of sense.
I think that initial setup make take a little while, mostly to become familiar with the configuration. But, code maintenance would be greatly improved using the Compass API compared with using Lucene by itself.
Very commendable work.

I think it time for bed now. Tomorrow starts bright and early.
After all the hotel food, I'm ready for a beer and a pizza :)
maybe Monday :-P

permalink
Links to this post
0 comments

Myth Buster: Spring is XML Hell

This one covers some stuff we're already doing: breaking up configs by area, using import tags, etc.
Ben does cover some things I didn't know, using factory beans. He, even recommends NOT using Spring to configure domain objects and every single bean. More, he says they recommend keeping Spring usage to dependency injection.
Another good technique, over-ridable default values in beans and factories.

Next is the parent/child bean definitions.
I've actually used this one a bit. It can make the config a little more difficult to read but, it definitely reduces the redundancy in configuration files.

Next, what I came here for: XML Namespaces
This is much cooler. There a many pre-configured tags for common cases like AOP, JNDI lookups, EJBs, autoproxy, etc. Ben then goes on to describe how to create custom namespaces.

The last subject is more about how to manage the configurations instead of reduce them. Tools.
He gives a little more demo of the Spring IDE. I'm going to have to give it another try. A couple of years ago, it didn't seem very useful but now, it appears to work very well. Informative warnings, auto-complete, what else could you want?
How about a bean viewer that shows dependencies across files and can show an object graph that looks a little like a class diagram.

This developer is impressed.

Answering a question Ben points out that auto-wiring is not really a good way to deal with the configuration files due to the loss of metadata. I'll buy that (of course, I'm not a big autowire fan anyway).

Much like his earlier session, he uses JUnit alot while changing code. Its nice to see stuff really work.

permalink
Links to this post
0 comments

The AJAX rundown

Finished "The State of the Ajax Framework World"

Pretty good session. Basically a rundown of lots (I mean muchos) of different frameworks for working with Ajax. Good descriptions, examples of most, and lots of code.
The result? Which to pick?
What do you get an 80 year old man for his birthday?

Basically, pick something stable that matches your application. They all have strengths and weaknesses and feature sets. Maybe I'll try to update this later tonight.

Off to learn how to manage the myriad of huge configuration files.
I need more coffee; fatigue is starting to kick in.

permalink
Links to this post
0 comments

Hidden Gems Notes

"classpath:" vs "classpath*:"
In the first, it gets the first classpath root only.
The second will check all classpath roots.

Both support patterns
"classpath:mypackage/*.xml"
"classpath*:mypackage/*.xml"
I will probably avoid the wild card pattern bit because of my preference for explicit definitions. Still, good stuff for parallel classpaths and resource roots.
---

Advanced Resource Bundles


ResourceBundleMessageSource: uses java.util.ResourceBundle, can load from multiple bundle basenames, can handle message arguments via java.text.MessageFormat
ReloadableResourceBundleMessageSource, think resource bundles that can be reloaded at runtime. woohoo! has configurable caching and refresh.
Sample definition:

<bean id="messageSource" class="org.springframework.context.support.ReloadableResourceBundleMessageSource">
<property name="basename" value="classpath:myBundle1,classpath:myBundle2" />
<property name="cacheSeconds" value="1" />
<property name="defaultEncoding" value="UTF-8" />
<property name="fileEncodings">
<value>
/WEB-INF/myBundle2_en=ISO-8859-1
</value>
</property>
</bean>

Note: storing reloadable resources in the classpath may not be the best practice. But, probably use in a dev environment tied to a server. Just change before go-live.
The encoding stuf is good but, anybody working for me will save EVERYTHING as UTF-8 if they know whats good for them
;)

ServletRequestDataBinder - I need to investigate this more

permalink
Links to this post
2 comments

Back in the Game

What day is it now?
Time to head out to see "Spring's Hidden Treasures". It claims to show some Spring things I may not be aware of. I'll bet there is a lot I'm not aware of so, it should make a good learning experience.

After yesterday's sessions, I was up till 2am playing with code trying to get a better idea of the things covered yesterday. It may take me a few weeks to distill everything learned and get it on the site.

permalink
Links to this post
0 comments

Friday, December 08, 2006

BOF - LDAP

Finished Keynote speech and dinner (surprisingly good).
Mattias Arthursson and Urik Sandberg are exceptionally competent and knowledgeable.
They also really know how to use the Eclipse IDE ;)
The code quality, even though it's just for example, is very good as well.
This really helped to fill the big hole in my knowledgespace (yes, I just made up that word) called LDAP.
This is a true developer session. More time in the IDE and little time in PowerPoint. Even their PP slides are full of code.

The LDAPTemplate just plain makes a lot of sense.

A good part of the session is occupied with Ulrik implementing a few data access objects (for users and groups) that are backed with LDAP. Sometimes one of the best things to help learn is to just see the code being written.

permalink
Links to this post
2 comments

Managing Deployments with Maven

This one would have been better if the presenter had prepared a little more. Still, it did make a pretty good intro to Maven 2 (much better than Maven 1.0).

Watching a Mac user in a bash shell is like watching a fish cutter with Parkinson's disease. It just makes you cringe.
:-P
And a shell with a translucent background sitting on top of another shell?
The mice are killing me, presenters must learn the art of the keyboard shortcut.

It looks like the Maven setup and Eclipse plugin are still a bit clunky but, may still be useful. I think this may need another 6 months before its really ready. But, maybe I'll try to spend a little time with it to see what else I can find.

permalink
Links to this post
0 comments

Power, power

The conference is becoming a bit of an exercise in laptop battery management now.
Run lightly, suspend often, grab a couple of minutes charge when I can :)
The Spring/DWR Ajax stuff was pretty good. Lots of techniques to keep the code under control.
Even had some usage of script.aculo.us. It had the standard web store demo, with a finale where google maps is used to show "live" tracking of a package en-route.

One of the good things about this presentation, it was very clear that Bram Smeets is an 'in the trenches' developer. Discussions were like just talking to a fellow dev.

I suspect a lot of dangerous code will be written based on that session.
The security aspect was pretty brief. But, since DWR basically runs out of a servlet, it should be clear what to do.

I swear, I've got to write a mailet for my James email server to catch emailed photos from my phone. This, email to self and scp to the server is starting to get old quick.

Break area:

permalink
Links to this post
0 comments

Lunch is over, time for DWR and AJAX

Who would have thought that 3 free meals could make a diet? Ok, no more bad jokes about catered food. The coffee is still pretty good, so, I'll survive.

Hopefully this will be another good session, and not full of buzzwords as the title suggests.
It'll be interesting to see what techniques will be shown here.

I'm still tortured by the beach. Its right out the window but, I'm in the sessions.

permalink
Links to this post
2 comments

Rapid Web App Dev

This one got started a bit late so it went very fast.
It was a little disappointing. I suppose I was expecting to see an app created from scratch...
Rob Harrop did cover a lot of good info though. Demonstrated integrating Maven and Jetty. He also pointed out some of the difficulties of Maven and showed a good way to get around. He also demonstrated many techniques for testing while developing.
There was a (very quick) demonstration of Site Mesh for site wide formatting. I'm always surprised that more people don't just use servlet filters for that. I guess we'll be seeing copied includes, and tiles for a long time. Site Mesh is a step forward but, I think I'll stick to filters. They're a lot more versatile and allow changing look and feel on the fly.
anyway, off to lunch

permalink
Links to this post
3 comments

Fundamentals Downs

Wow! Lots of great information, almost too much too fast. Almost ;)
I'm going to have to do some homework from my notes.

Two types of dependency injection, constructor and setter.
Answer to which to use? What do you get an 80 year man for his birthday?
depends
Setters have more meta-data, constructor is always guaranteed.
Ben Hale suggested the hybrid approach. If you absolutely gotta have it, go with the constructor method. Otherwise, use the setter method for the additional meta data.

Saw the latest SpringIDE plugins to Eclipse. I'm impressed.
He covered a lot of the philosophy of writing all the code in POJOs and using enterprise decorators to make the good stuff.

I love the suggestions in the stack traces in 2.0, too sweet.
Got quick intro to EasyMock, I admit I've known of it but, never really used it.

The AbstractDependencyInjectionSpringContextTests class for integration testing. Very cool, even if the name is too long. It'll be better than our old method for those types of tests.
AOP * proxy endpoints for EJBs, whats not to love?

permalink
Links to this post
0 comments

Spring Experience

Well, I'm getting started with day 2.
It feels like I'm back in school, ++
Lots of stuff to cover in just a few days.

Last night at the Keynote, Rod showed a few of the new things with Spring2. I really like the methods for getting XML configuration files under control.
Breakfast was standard, horrible, hotel stuff. Nice presentation, no flavor. At least the coffee is strong :) (and its Starbucks, like being back in Seattle).

Time to get in the fundamentals session.

permalink
Links to this post
0 comments

Monday, December 04, 2006

Serialization and the Collections API

I've put a little article up on my site. Its just a discourse on how some some best practices can come into conflict when using libraries, in this case the Collections API.
Its nothing against the Collections API but, food for thought when writing library code so that you can give consumers a helping hand.

permalink
Links to this post
9 comments

Swarm of Ideas Update

I've posted the list of entries received so far on my site.

Comming soon will be a commenting system and probably a wiki around the thing too.

permalink
Links to this post
0 comments

Friday, December 01, 2006

Spring Itinerary

Update: I've changed the schedule a little based on previous sessions

Well, here's what I've tentatively decided will be my itinerary at the Spring conference.

Friday (Dec 8):

Saturday (Dec 9):

Sunday (Dec 10):

permalink
Links to this post
1 comments

Ideas from the Mechanical Turk

I've recently posted a couple of questions on the mturk site.
One is for ideas for programs and another for ideas on improving email.
The first one returned some really good results, the second not so great. I think that for this to be effective, you really need to ask the right question, and ask carefully.

I'm going to set up a site for the program ideas where others can post comments and code as well as vote for the ideas. It'll be interesting to see what comes of it.

The ideas for email will probably be used in the book I'm working on about developing with the RCP.

The questions are still open so, if you have an idea, add a comment or go to mturk and earn 9 or 10 cents
;-)

permalink
Links to this post
0 comments