15
Aug 09

WorldTimeEngine: How to show all times in user’s local time zone

When I visit some site and it shows me that some action performed at some time – it confuses me a little, because I don’t know in which time zone is this time.
Sure, you can spend some time to read about one’s time zone settings and rules, BUT Don’t make me think. Every website uses his own rules for time setting – some uses GMT zone, some says something like: London or New York or Moscow time.

I, as a potential user, will be much more satisfied if I would see the only one explanation:

All dates and times are in your local time zone settings.

Sounds easy, yet powerful. And on the other hand – hard to implement such flexibility.. But it’s really not.

Continue reading →


05
Mar 09

Memory Palace method example: Strategy pattern

This post is a sequel of previous How to start using Design Patterns post, describing the Memory Palace memorization method. I recommend you to read it before starting to read this post.

For example, I can use my sitting room as a basis for the remembering path. In this room I have the following objects:
Table, big bright window, lamp, sofa, picture on the wall, small bookcase, CD rack, telephone, television, DVD player, chair, mirror, black and white photographs, etc.

I want to put all the units required for remembering the StrategyContext implementation in that room. I’ll start from window and will move to the door out of the room.

When I hear the word “strategy”, the first image comes to my mind is an ancient roman warrior with armors. “Context” associates with Jacuzzi for me(something that surrounds you). So I “see” the roman warrior sitting in the Jacuzzi(pay attention at bubbles and moist air in the room).

Here is an example implementation of the GoF Strategy pattern, main concept of which we want to remember:
I’ve taken it at Strategy PHP example from software pattern catalog:
Continue reading →


05
Mar 09

stackoverflow

Finally have decided to register at stackoverflow.

I like to talk on software development related topics, asking question and provide some recommendations to other developers. Sometimes I face different unique challenges, which is not described in the software dev books – in that cases all you can do is to rely on your own experience.

One head is good. No, not like that :) One good head is good, but a community is much better. In that way our experience summarize in solving particular problems, and answering particular questions.

I like the community it has, type of questions and discussions manner.


28
Feb 09

How to start using Design Patterns

I remember myself procrastinating in using of Design Pattern in production code, after reading the information about the GoF patterns.

On the paper everything looked very easy and understandable. But after you might fall in trap of fear of using this knowledge in production code, because:

  • You have a very limited time dedicated for the task. So you can’t find the time to do the things “in right way”
  • You haven’t enough experience of some particular Design pattern, so you don’t know how to exactly implement in real problem solving. So you spend more time and get out of time scope for task and schedule. So you decide to refuse “the hard right way”, and implement an easy and dirty “temporary” solution.

If you refused to implement the pattern, you haven’t improve your experience with this pattern. It is an infinity loop: you can’t implement because you don’t have a required experience. Time passes, and you will have the exact same problem in future, and the initial conditions(level of experience with particular pattern) are still low.

I was in this loop for a couple months. And after I recognised this behaviour habit, I’ve asked for help more my more experienced co-workers. The advice was simple and easy:

You can’t succeed without failure. If you want to become more experienced in Object Oriented design and Design patterns, you have to have a will in this trend, and still moving nonetheless the periodic temporary failures.


28
Jan 09

How to remember software design patterns

Who likes to learn from the scratch the same issues over and over again. Assume, that nobody.

But sometimes we have to do so with design patterns, because that is not the case we have a close contact with every of 23 classic software design patterns.

I don’t remember, who wrote that:”we uses implementation patterns every hour, we uses design patterns much rarely, and we use architectural patterns mostly at the start of the project”.

And when we don’t use some of our knowledge for quite a long period of time, we actually loose this knowledge, and will have to learn it again, when we need it.

I think, that design patterns are worth remembering, because it is not the case, when you’ll have to forget it later, because something new will appear. Software design patterns are core solutions for constantly appearing daily design tasks. And mostly, it doesn’t attached to particular programming language, or framework(but every implementation has its own differences).

Continue reading →


10
Jan 09

Session management after automated deployment best practices

Now, I’m working on automated deployment platform for LAMP
environment, using Apache Ant.

Now it looks, something like that:

1. blocks all requests, and display “Website is under construction
page.
2. implement database schema updates
3. update the application’s source code
4. unblock all the requests and hide “Website is under construction” page.

I thought, that we need the following:
after third, and before fourth point I want the webserver to drop the sessions of already loggined users. I think, this practice is useful for automated deployment, because there might
be significant changes in sessions handling and in the application
core itself, so it is better to drop users’ sessions and force them to
login again.

Because it is an automated deployment and usually take very small time, so we can’t wait when loggined user’s session will expired.

Continue reading →


23
Dec 08

Index page “Under construction” while deploying

I have noticed a few times earlier on different sites an index pages with title “Please be patient, while we are deploying new software version. You’ll like it”. And one day, I decided that it is the time, to integrate the similar feature to our automated deployment process.

I think, that this page has to show user some indication of action progress(real or fictional), not just a static page, user has to refresh to see if it is finished or not. What user has to do – is just open once the site, see the message, that it is “Under construction”, and stay the page for a while.

It has to refresh itself until the time, deployment has finished. After that it has to load index page of new version’s website.

I wan’t to tell you, how and when this new index page is setting up. Right, all the deployment processes can vary a lot depending on the software it deploys, environment it uses, deployment tools etc.

under_construction1 Continue reading →


23
Dec 08

Versionable static content deployment

Recently, at some project, we planned to dedicate some time to improve our deployment and build packing process, so we can use the solution in future projects.

What we decided to do:

  1. make a pack of all the Java scripts and CSSes, to reduce the page load time
  2. make a static content versionable

If first is quite a common practise, I wan’t to tell more about the second point, on example.
We use an automatic deployment system. So installing of new software version can be done easily and takes little time. So, for example, if we faced some serious bug with CSS, something is very bad with User Interface and the problem is with some external CSS directive.

If we will just change solve the problem, locally in those CSS file, make a build and upload it to the server we’ll have some users, with loggined sessions and cached CSS files in browser. We have uploaded the fixed version of CSS, but user still see the old one, with bugs.

The same problems can arise with all the static content(java scripts, CSS files, images).  So we decided to make that content versionable too.  Main purpose is to force the browser to load new version of those content, when we deploy new version.

That is how we decided to do that:

Continue reading →


23
Dec 08

phpUnderControl

Recently, I had an invitation to participate to some project, which where in development for about a year. The product was quite successful, but stack holders decided to improve its performance, reduce bug-level, develop lots of new features, otherwise get a more loyal customers and make it more profitable. So, for the start, let me tell you about the environment. It was the following:

  • absence of automated process of deployment
  • zero unit-tests code coverage
  • quite low skills of working with repository

So, the consequences are not unexpected:

  • big amount of bugs, even in production
  • deployment was quite rare, difficult and sometimes error prone(especially in the case, when there was need to rollback to previous version)
  • software integration problems
  • DB integration problems
  • consequently, low motivation for producing lots of new code, because it is always scary and many unpredictable bugs arises in different places

Significant part of those problems can be eliminated by improving the development and deployment process. That is what we decided to do, at first. So, after that I  decided to talk with the people, mostly involved in the planned switch – developers, QAs and the system administrators.
Continue reading →