2009-04-27

Time is the simplest thing - what is the cost of leisure time

First and basic rule: our personal time is scarce resource.

I realized that I'm playing in one of online games way too long- it took me about half an hour per day. Despite of fact that at the beginning it was really fun and now its sort of social experiment with gaming background, it's just leisure time. Everybody needs some relax but I felt guilt for not using my time in more productive way.

I've quickly calculated my often used average wage per working hour and applied that to time saved by dropping some of my leisure time. That's the coarse result that says something about earning more money instead of spending time in other unproductive way. But reality is more complicated than that simple model. There are other factors that should be also considered:
  • conversion of free time into work time is a must (what if freed time will be used in another way?)
  • extra costs of additional work
  • demand for our work services (supply and demand effect) could change our price
  • costs of shortened leisure time (too much work without rest could cause bad results, like burnout)
  • effect on life goals

As a result, limited time forced me into thinking about balancing life activities. Sometimes money is not enough to sacrifice more personal time for work.

What are your way of dealing with that kind of situations? What is your time worth? Any tips for balancing work, leisure, family time?

2009-04-26

Spring break

In April I broke my weekly posting schedule. Don't panic - it's only a break! Taking few days off at Easter time, spring cleanup and regeneration, and then back to heavy work when one of the clients backfires with new features request - I lost attention for some of my routine task. At least we have nice spring, that makes me feel better (my bike is ready - now it's time for me).

I've checked readership statistics and unsurprisingly it dropped by about 30%. It only confirms that people (or bots) are looking for fresh content.

I want to thank to all my readers, the very specific ones that not get bored easily reading this stuff. It is the last thing that keeps me writing.

More feedback is appreciated - so leave your comments.

2009-04-06

How to get (rid of) Anemic Domain Antipattern coding multitieried enterprisey application

Programmers want to make "good designed", "enterprise like" application. So keeping in mind boxy schema of multitiered application they start to organize code into separate layers like most common DAO,Service and Domain. Very often that way leads to Anemic Domain Antipattern. It's characterized by "dumb" C struct like domain objects without logic in methods.

The mechanism is simple: programmer wants to keep layers separate and dependent only on common interfaces. To reduce wiring and simplify initial development DAO object are connected to Service layer which uses also Domain objects. Service layer is filled by Script like methods, written in procedural style. That way of development is easy at the beginning. So main logic goes to Services "layer" and data operations go to DAO layer. After some time Services become really fat, but domain objects gain only more attributes and accessor methods. As long as application is a kind of a prototype, or just is small everything works quite good.

But to get more benefits of object oriented programming in future, we need net of more "intelligent" domain objects "talking" to each other, not just logic closed in services layer scripts. At this moment that could only be done by total refactoring, or just by designing from scratch using experience from previous implementation. Just keep in mind mantra encapsulation, reusability, simplicity.

The simplest cure to that antipattern is to design "good wiring" at the begging, to give domain object direct access to DAO layer, and other low level services needed by domain logic. Then, domain can evolve easy into more complex structures, needed by bigger "enterprise" applications.

2009-04-01

Another point of view on Object Oriented Programming problems

It's not another article about OOP pros and cons.
I want to present you a non orthodox example of dealing with common programming problems without using standard OOP patterns.

The site is for some time on the web already, and presents controversial articles about OOP and SQL criticism.

I don't agree with author's overall point of view, but many ideas are very usable in specific simple applications development, and some of patterns presented there could be found in current RAD frameworks.

Just read and brainstorm.