Wednesday, February 27, 2008

javascript is dirty

today a colleague tried to execute javascript with placeholders for a wicket component, no matter if it is rendered in response to an ajax request or in response to a normal request.

one possibility would be to append the javascript to the component markup. this way it would be executed whenever the component is rendered. but what about the placeholders in that script? he said, he could use wicket label components in the javascript that does not render its tag (e.g. a span) but only its body.

after all javascript would be a dirty language anyway (e.g. because of browser incompability), so why not try this dirty approach.

Friday, February 15, 2008

grails orm (gorm)

grails object relational mapping is so great. it`s based on hibernate and one of its coolest features is dynamic finders. a dynamic finder in grails is a method for querying data that does not exist up front but is created at runtime.

consider a domain model class user which has properties birthday and username. you can then query data calling User.findByUsername(uname) or User.findByUsernameLike(uname) or even User.findByUsernameAndBirthdayLessThan(uname, beforeDate) without implementing or even declaring these methods in any way - they are generated dynamically at runtime and this is mainly possible because of groovy`s dynamic features.

checking out grails

one week ago i started trying out grails and it`s really amazing how `convention over configuration` accelerates web development. a grails application consists of three (or four?) layers: a set of views and controllers (one for each domain model class), a service layer and a persistence layer which is integrated into the domain model (this is quite a new approach, i think).

the project starts creating an empty domain model class which actually grails creates for you from the command line. then you need to fill this class with its properties. grails can then create all other components (view, controller, persistence, tests, ...) for you either using scaffolding (i.e. components are generated at runtime) or by generating the according groovy files. the generated artefacts are created based on useful defaults (the basic crud actions are implemented) and can be customized by the developer later on.

all in all i`m very confident with what i`m able to do with grails after only one week. but i think what helped very much is that i`m a bit familiar with the frameworks used by grails (groovy/java, spring, spring mvc, hibernate). the next days will go on learning grails and have a deeper look into the details of the different layers.

beginning groovy

last week i started to learn groovy. i think i heard about groovy for the first time at the beginning or in the middle of last year and it´s getting more and more popular. at a certain point last week my curiosity had reached maximum, so i gave it a try.

groovy is a dynamic programming language that runs on the JVM and it´s quite easy to learn for java programmers. as it runs on the jvm you can use existing java libraries in groovy as well as you can use groovy scripts in your java applications which at the moment seems the main use case to me. mainly due to its dynamic features groovy offers more flexibility and an increased productivity opposed to java in some cases, which is probably the primary goal of groovy. in other cases you will probably miss some of java´s features (mainly static typing).

my first impression of groovy is that with some experience you can do simple things really fast, for example text/data processing. in this case groovy comes with really helpful features like improved support for regular expressions, closures, builders, native support of lists and maps, ranges and groovy strings.

maybe the next days i will get into details of some the coolest features of groovy, e.g. closures, and when i feel experienced enough i`ll try grails, a groovy web application framework.

first post

hi, my name is nick. i`m a software developer from germany and in this blog i plan to talk about web development, related technologies and IT in general.

in the first place i start this blog as a personal blog to record the history of my (hopefully) growing experience in software development. my background: i started web development about one year ago. so my experience in this area is not quite big. but maybe this is why this blog could become interesting.

currently my company is developing web applications using java. we use wicket for the front end, spring for the business tier and hibernate for persistence.