Personal Workflow Blog

To content | To menu | To search

Friday, 31 July 2009

Databases: Better Defer Constraints than Avoid Them

Constraints are considered a Good Thing. They enable to rely more heavily on the validity of the database. It is quite important to note that validity is in terms of modeling and not in terms of business [1].

The biggest complains we can have about constraints is that it is sometimes quite annoying to do some updates while consistently validating the constraints. You have to care about the order of the operations you do.

Notes

[1] I'll write an article about this later

Continue reading...

Wednesday, 15 July 2009

Checked or Unchecked Exceptions for Legacy Code ?

This question can almost trigger a religious war. On Internet no fixed consensus on the matter seems to exists. But most of the articles there have usually something in common : they are always mostly applicable when you start a new application.

Is the situation the same when you have a certain amount of existing code to maintain ?

Continue reading...

Tuesday, 2 June 2009

Databases: Efficient Denormalization with Views

Everyone is unanimous that database normalization is considered a Good Thing.

But it usually comes with a cost : writing queries can be very tedious since you always have to join many tables together to be able to retrieve useful human data from all those reference tables.

Continue reading...

Monday, 1 June 2009

Equality in Java is a Hot Topic, but a Hazardous one.

It seems that comparing two objects isn't as a simple task to do as it seems at first.

My concept for smart comparison still holds, but is completed perfectly with the How to Write an Equality Method in Java article posted on Artima soon after mine[1].

2 main points that you have to be careful to (Others are also detailed in this article) :

  • hasCode() has to be redefined usually since otherwise the equality contract on Object.hascode() would be broken.
  • the equals() has to take an Object as parameter since overloading in Java is resolved by the compile-time type of the argument, not the run-time type.

I just got bitten by the second one, but not much (yet) since I mostly rely on compile-time overloading. My purpose here was only to compare objects either to constants or to simple variables. But in the generalization I would certainly have overlooked this and be bitten much more deeply.

Notes

[1] But as much as I wished it to be, it is not related :-)

Friday, 29 May 2009

Synthetic Style for Blog Posts : Presentation Style Blogging

The good

  • With SMS, IM and now Twitter becoming more and more predominant : ideas might be given as bullet points
  • A presentation is much more dense in meaning than a big blob of text, Less time is required to read the post and be inspired by the content
  • Blogging is much less time consuming. As Jeff Artwood said Quantity Always Trumps Quality, it is the commitment that is important (hence the schedule).
  • You might divide a long article in several short and related posts.

The bad

  • Blog articles are usually a medium-depth analysis of a problem whereas presentation are usually a written support of a more detailed oral presentation.
  • Presentation sentences are usually hard to understand since they are just headlines without the underlying context.
  • You can always do a fast-reading version by putting the important sentences in bold for all those hasty readers.

The ugly

  • Longer don't always mean more interesting. Voltaire said Perfection is attained by slow degrees; it requires the hand of time. and Antoine de Saint-Exupery completed Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away..

Conclusion

As concluded by Pascal, I made this letter longer than usual because I lack the time to make it shorter, a good and terse article is therefore much more difficult to achieve. Therefore Presentation Style Blogging may be a false good idea.

- page 5 of 10 -