Thursday, November 27, 2003

PATTERNS: knit one, pearl one

In books like the racy The Struts Framework, you will often come across stuff like:

"The ActionServlet represents the Controller in the MVC design pattern. Additionally, the ActionServlet implements both the Front Controller and the Singleton pattern"

If you havn't a clue what this man is talking about, then you need to get into design patterns. Gamma et al describe them as:

"A design pattern systematically names, motivates, and explains a general design that addresses a recurring design problem in object-oriented systems. It describes the problem, the solution, when to apply the solution, and its consequences. It also gives implementation hints and examples. The solution is a general arrangement of objects and classes that solve the problem. The solution is customized and implemented to solve the problem in a particular context."

For a brilliant and very readable introduction to patterns i'd reccomend, Java Design Patterns - A Tutorial. Equally brilliant from a J2EE perspective are: Core J2EE patterns and Patterns of Enterprise Application Architecture.

If your feeling keen, you could attempt the seminal work: Design Patterns by the Gang of Four. This is a bit more hard work (all the examples are in C++) but rewarding in a slightly pervy computer-science-tanktop kind of way.

Finally, if you arrived here by mistake and are thinking "who this pompous git showing off about his dull computer books" perhaps you'd be better of with Brenda's crayon scribble pullover.

Wednesday, November 26, 2003

Double Computing

Just checked my timetable and it appears we have double computing again this afternoon. The really sad thing is that we are going to have it again tomorrow morning!

Sat at the back with Pants. He reckons if I let him see my Lotusscript then he'll let me have one of his refreshers.


Fold to live, live to fold

My folding bicycle "Lucille" has returned from dry dock. Thing is, you either have style or you don't.

WSAD: Of debugging and other daring do.

WSAD, or as I heard a Blue Meanie pronounce it "Wussad", is a giant champion sumo wrestler as software goes. It needs a minimum of 512mb RAM to run, but probably a hell of a lot more. Needless to say, it is far too big and hairy for my effeminate laptop.

Still, that aside, here is a small note on its debugging capabilities, which I have been playing with recently (a cry for help?). Rather than dribble on in any great detail, I shall just point out groovy bits that you don't get with Domino Designer.

  • Run to Line: You can simply stick your cursor in the source, right click and execute "Run to line". This, as you would imagine just jumps to that line. I realise you could just add more breakpoints but a nice touch.

  • Viewing variables: when the debugger is running you can hover over a variable name in the code and a popup window will appear showing the value. This works for simple variables and it even shows the javadoc if there is any. For objects, there is a variable window where you can expand and view all member variables etc.

  • Display View: In the debugger you can open the display view which enables you to evaluate java expressions. For instance you could type in a variable name (name) and add something to it (name + " hello"), highlight and right click and the result is displayed "Spuggy hello". Furthermore, you can change the value of variables by executing assignment expressions in the display view (name = "Blue Meanie"). These values will be used through the rest of the executing code.

  • Hit Count Breakpoints: Add a breakpint and edit its properties. The hit point allows you to state how many times you want the breakpoint to be passed before suspend execution.

  • Logic condition Breakpoints: Similar to the hit count but suspends when a particular expression is reached(name.equals("spuggy")

  • Exception Breakpoints: Exception breakpoint are like being able to say "jump into the degugger when Object not set happens". This feature allows you to select an exception from a list and add it to your breakpoints view. Anytime this exception is thrown the debugger will susspend

  • The Scapbook: Not officially part of the debugger but a feature that allows you to quickly type in code to experiment with, rather than entering straight into the source and waiting for big compiles.

  • Hot code replace: This feature enables you to fix the buggy code there and then, rather than closing the debugger down.

I thank you.

Monday, November 24, 2003

APACHE: Enabling Server Side Includes

One down side of using blogger, is that you are denied the near orgasmic pleasure of producing your blog in bloody Lotus Domino. I realise I have the opportunity of using one of the many fabulous free Domino blog templates, but ... well I just can't be arsed. I wanted to have fun, sort of.

Anyhow, to have a link section on the left hand side (and other stuff) I decided to use server side includes. This involved:

1. Creating a .htaccess file and shoving it on my web server:

# J2ME Stuff

AddType text/ jad
AddType application/java-archive jar

# Server side includes

AddType text/html .htm
AddHandler server-parsed .htm

2. Adding the includes to my blogger template and associated files like this:
<!--#include virtual="/links.htm" -->

Bit of fannying about in places but largely painless.

P.S I briefly entertained using XML and XSLT but became nervous of the browser support. Cowardy Custard.

Sunday, November 23, 2003

J2EE: Of packages and script libraries

Packages are away of organising you code in java, just the same as script libraries in Domino. The rather dinky Elements of java style states:

"Place types that are commonly used changed, and released together; or mutually dependent on each other; into the same package."

Examples being:

Calendars Dates and Times
Points and polygons etc etc

They go on to give even more advice on using packages to isolate volatile classes; making sure you are careful about dependencies between packages; and using packages as the effective unit of release (rather than individual classes).

Its all rip roaring stuff (really?). Thing is how do they look in real life? It's all very well to bang on about polygons and circles, but I can't remember the last bit of code I wrote that needed any. That's a lie actually, I did write a program in basic in 1983 called the "Purple poo eater" that needed a circle, but that's another story.

Anyhow, whats a real world example of packages? In the extraordinarily absorbing Enterprise Programming with websphere they give a good example of packaging in J2EE application.

The packages are based on the architectural layer so the names could be:

  • domain: business logic stuff

  • mediator:mediator classes

  • panel: panels in presentation layer classes.

  • system: system classes used to provide services to all layers

  • testscripts: testscripts used to drive the domain logic

  • mapping: mapping layer classes, that is mapping between objects and a relational back end database

  • controller: controller layer

  • applet: applets stupid

  • frame: frames defined for standalone applications

  • util: utility classes independent of any layer

Following this convention, the packages for a simple J2EE app could be:
  • com.spuggy.domain

  • com.spuggy.servlet

  • com.spuggy.mediator

  • com.spuggy.system

  • com.spuggy.util

  • com.spuggy.testscript

Finally it's worth mentioning that Elements of java style is co-authored by the fantastically named Greg Bumgardner. I tried to search google to find a link to him, and by accident stumbled on the legendary Rusty Bumgardner. Go Rusty.

Friday, November 21, 2003

If music be the food of love ROCK ON

The ukulele video has arrived. As it says on the liner notes:

This video will give you an excellent overview of the ukulele's potential for a variety of musical styles, and a renewed enthusiasm for what Bob Brozman calls "this noble little instrument."


As Leonard Nymoy said "if music be the food of love ROCK ON!"

Thursday, November 20, 2003

Fray Bentos

Gonna get me a VW campervan. I've always wanted one and the time is now. Furthermore, the Mrs is moving us to the country so I may be working away from home a lot.

It occurs to me that there is the real opportunity for me to finally become an itinerant 21st century ├╝ber-gypsie. In the day I will be a steely-eyed-missile-man of an IT Contractor, whilst at night, I will be living in the campervan in a pub car park near Cheam.

For tea, I will eat fray bentos steak and kidney pie.

Live the dream.

Websphere Certification

Ok lets get a Websphere certification. I like little cheesey exams. They are meaningless but strangely seem to motivate tired, shagged out old b@stards like me.

Here are some options:

IBM Certified Associate Developer - WebSphere Studio, V5.0
Entry level, requires exam 285 which is maily aimed at getting around Websphere studio, debugging JSPs etc

IBM Certified Solution Developer - WebSphere Studio, V5.0
More involved requires you pass CIW Web Developer which is JCERT test covering basic J2EE stuff. In addtion you must pass 286 which looks pretty similar to 285. From initial looks it dosn't appear that you can stack up exams like the old Lotus/Novell electives.

An alternative to the CIW Web Developer is the Sun Java 2 Programmer. This seems odd as this is the basic J2SE exam which dosn't deal with J2EE at all. Hey Ho.

IBM Certified Enterprise Developer - WebSphere Studio, V5.0
This the biggy, For anything with enterprise in it your going to have to understand EJBs. To get this creditation you must pass:

Sun Java Programmer (1.2 or 1.4) - 310-325
Object-Oriented Analysis and Design with UML (486)
Enterprise Connectivity with J2EE V1.3 (484)
Enterprise Application Development with IBM WebSphere Studio, V5.0 (287)

IBM Certified System Administrator - WebSphere Application Server V5.0
Basic admin exam 340. Again admin without EJBs, single server.

IBM Certified Solution Developer - IBM WebSphere Portal for Multiplatforms V5.0
This dosn't exist yet (only 4.1) the link points to the new exams due in 2003 ... hmm gettting a bit late. There appears to be a deplyment and development exam so it remains to be seen if this will remain one thing.

So, the associate exams look a bit pointless as they are all about remembering the menu options is WSAD. The solution developer looks a good bet for first dibs but the question is do you do the CIW exam or just the Java Programmer? The CIW content is worth knowing but the exam is not used in any of the further certifications.

So, I reckon its the solution developer with the J2SE programmer.

As Joey Ramone said, "Hey ho lets go"

Wednesday, November 19, 2003

International Cheese Awards are on again

The International cheese awards are on again. I know what I am voting for. Do you?

There is wickedness in Babylon

Computer programming, for those who have noticed, is excruciatingly dull. To do it for any length of time often requires mind games and distractions. Myself, I listen to dub reggae. Dub is mainly remixed versions of well know tracks with the emphasis on the bass and drums.

So, being kind of ambient music, dub allows Johnny programmer to concentrate on the task at hand. The best bit is that occasionally there is the odd smattering of vocals from the original track. This is handy, as it gives you the opportunity to join in and alarm your work colleagues.

My particular favourites are: "There is wickedness in Babylon!" and "rastafari ALMIGHTY GOD!".

For those keen to experiment with the benefits of dub, I can heartily recommend Augustus Pablo and the mighty King Tubby

In fine style. Ahem

Tuesday, November 18, 2003

Computer Programming the whys and wherefores

Some of you are out there right now creating software for the 21st century. Myself I am still Airfix Modelling.

Some of you relish the challenge of the web service or servlet, but for me its still all about the Focke Wulf or HMS Fearless.

Locate and Cement!

Monday, November 17, 2003

More important lyrics

Very excellent lyrics from the 1970's

Love Machine lyrics

I'm just a love machine
And I won't work for nobody but you,
I'm just a love machine,
A huggin', kissin' friend.

I'm gentle as a lamb,
I'm not that hard to program,
There's no way that you can lose,
My chassis fits like a glove,
I've got a button for love,
That you have got-to-use.
If you look into my file,
I am sure you can find out how,
To turn me on just set my dial,
And let me love you for a little while - ooh


Na, na na na na, na na na na, woo-woo-wooo
Na, na na na na, na na na na, na naaah


Depression - a simple treatment

In the west depression is often teated with a cocktail of powerful drugs, which often have serious side effects. I prefer the simpler approach of reading Benny Hill Lyrics.

To achieve maximum effect, the lyrics must be read slowly like you would serious poetry.

"Now Ernie loved a widow
A lady known as Sue
She lived all alone in Linley Lane
At number twenty two
They said she was too good for him
She was haughty, proud and chic
But Ernie got his cocoa there
Three times every week
They called him Ernie (Ernie)
And he drove the fastest milkcart in the west"

Sunday, November 16, 2003

Slide Ukulele

This is my version of a famous Led Zeppelin track played on slide ukulele. Name that tune.

I mean slide ukulele ..... I wonder if the Great One ever tried?

Websphere its bigger than both of us.

Websphere. Its bigger than both of us, and its not a wagon wheel.

I'm not sure I can type another line of Lotusscript. It gives me a nose bleed.

I have bought this book An Introduction to Web Application Development with IBM Websphere Studio . I am going to pass the exam and become a millionaire before they send all the jobs overseas. You just wait.

This page is powered by Blogger. Isn't yours?