March 2010


Pretty Faces

I’ve used OcpSoft for my website mainly for search engine optimisation (SEO). When I generate my XML site map, it references “/about” rather than the specific JSP page. This means I can change my filenames without fear of broken links.

And it looks nice too. You might even go so far as to say it was erm pretty!

http://ocpsoft.com/prettyfaces/

An interface is blueprint/agreement with the rest of the world for how any object that implements it can communicate with the object it defines. Hope that makes sense. They contain the definition/format, but contain no business logic (see abstract classes). The interface can exist without any business logic even being built. Any class that implements the interface must also implement all methods declared.

List<Beer> graeme = new ArrayList<Beer>();

for (Beer beer : pub.getBeers()) {
graeme.add(beer);
}

I recently got asked do you know what a stored procedure is. Erm, it’s a SQL query that’s instantly executed and is therefore faster than adhoc queries. Yes, but why is it faster… Ooo, errr, most likely cached, coz someone once told me it was… not a very good answer at all.

Turns out they are fast for a number of reasons, the best one I found was validation. Other benefits include reduced network traffic and can help against SQL injection.

http://stackoverflow.com/questions/208976/are-stored-procedures-faster-for-simple-queries