Ika's Weblog XML
Architecting the Thought.

After a very painful data-migration process

The blog has moved to a new location: www.freshblurbs.com

Please, kindly update your RSS Reader with the new URL:
http://www.freshblurbs.com/rss.xml

I apologize for the temporary inconvenience but in the long run the new server is going to be much more featue-rich and comfortable, benefiting both me and my kind readers.

04/28/05

Microsoft "Sees" the Future of Your Kid?

 Microsoft sucks.

posted by irakli, 11:28 | link | comments

04/24/05

Closer - Movie

Doug has blogged about the new movie - Closer, recently.

I guess, he did not like it much, and since I trust his movie taste (and since I was REAL busy), I did not get it. Today, I was shopping at Costco and ran into Closer's DVD. Well, I really love Natalie Portman and respect Julia a lot, so curious to see what was so, quote, "badly-tasting" in this well-awarded (2 Golden Globes, 2 Oscar nominations) film, I grabbed it, immediately.

The movie is very well done. That, by the way, was in the quote Doug posted, too: "while his work, the script and especially the work from the four leads is solid to terrific, I just wish that their characters and the overall film didn't leave such a bad taste in your mouth and/or lead to the urge to shower after watching it due to all of the ugliness that's present." I can not agree to the "ugliness", part though. I would not expect SreenIt! to look only for bright colors in a movie. That would be too stupid. So what did they find so "ugly"?

I guess, it is a matter of - whether you can relate to the story, in the movie, or not.

If you married your college sweetheart, and lived happily ever after - it may seem "dirty", but not everybody is that lucky :) Things happen in life. Hey, life _is_ dirty itself. So, why should cinematograph try to brighten-up the reality? I do not like phony movies, much.

So, my final verdict - two thumbs up. Very well done, and did not seem like a movie, you need to shower afterwards, to me :)

posted by irakli, 22:37 | link | comments

04/23/05

Quick Java IDE Comparision.

IDE Like Dislike
IntelliJ IDEA Real intellijent. Outstanding refactoring features. Significant number of plugins. Very heavy. Each installed plugin slows it down significantly and it is quite slow itself, too. Also, it is heavy both on RAM and CPU. Even with 1GB RAM, because of the CPU overhead I could not afford having IntelliJ on my Mac Mini.
Borland JBuilder By far - the most good-looking IDE. Borland skin rocks and everything is way intuitive/comfortable. Very friendly. Decent refactoring features abd quite intelligent, overall, especially the 2005 edition. Not many plugins. Expensive, expensive, expensive! Yes, there is a free Foundation version but after trying the Enterprise version, only insane would suffice with the Foundation. Enterprise version is way over what I or even my organization can afford. With recent rumors, one might hope, though. From the other hand - will Eclipse be able to adopt fully, what is good in JBuilder?
Eclipse Unmatched community support. Eclipse is _the_ editor, if you want de-facto standard. The most number of plugins is just a by-product of that :) I especially like Hibernate plugins, JBoss IDE, CVS Browser (!!!) and web-browser plugin (comes real handy for keeping nicely HTML-formatted unit-test results within the sight). Far from being pretty, to say the least. Not very friendly or intuitive. Weak refactoring support. Initial set up of a project from CVS was a pain. Forces its "style" real hard. If you want to work in Eclipse - you better wear their hat. Other IDEs are not so "conservative", or I would say - such pain in the ... For example, it did not like how I had test source folders separated into three and JUnit functionality does not work, keeps complaining every now and then. And let me repear - when you spend most of your day in one program - you really wish it looked better
NetBeans. Integrated profiler. Very advanced Ant integration - Ant is how NetBeans configures/compiles project natively. Wonderful JSF support (even though I hate JSF). Not many plugins. Most of the available ones are not free, e.g. JBoss plugin is available but costs 15$ - 50$

posted by irakli, 22:01 | link | comments

04/20/05

Rss and atOM utilitiEs (ROME)

" ROME is a set of Atom/RSS Java utilities that make it easy to work in Java with most syndication formats.

Today it accepts all flavors of RSS (0.90, 0.91 Netscape, 0.91 Userland, 0.92, 0.93, 0.94, 1.0 and 2.0) and Atom 0.3 feeds.

ROME includes a set of parsers and generators for the various flavors of syndication feeds, as well as converters to convert from one format to another. The parsers can give you back Java objects that are either specific for the format you want to work with, or a generic normalized SyndFeed class that lets you work on with the data without bothering about the incoming or outgoing feed type."

posted by irakli, 14:01 | link | comments

04/18/05

Adobe Acquires Macromedia

posted by irakli, 12:12 | link | comments

04/17/05

Persistent Domain Objects Pattern.

Abstract

Persisting domain objects is one of the most challenging aspects of designing a flexible and testable enterprise application. There are lots of examples, in the industry, when developers get it wrong and end-up either with an effectively procedural, non-object-oriented structure and/or a highly complicated, tightly coupled design which is hard to unit-test.

Persistent Domain Objects Pattern gives a solution to resolve tight-coupling of the persistence and application logic code. PDOP decouples those by extracting the details of the persistence implementation and hiding it behind an interface, employing Dependency Injection techniques. As a result, domain objects do not need to know or worry about the details of the persistence code and can concentrate on their main task - delivering encapsulated data and behavior that models the domain under question. It, also, makes domain objects, much easier to unit-test in isolation from its dependency - persistent storage (e.g. database). Effective unit-testing increases the quality of a programming code and its extensibility.

Scope

Domain Model, Persisting Domain Objects.

Problem Definition

The core of most applications is their Domain Model. A Domain Model defines business rules (behavior) and the data that the business rules apply to. The behavior and the data are encapsulated into objects that form a hierarchy and can interact with each-other, thus effectively modeling the domain reality. For a wide-range of applications this Object-Oriented way of modeling the real-life scenarios works with the best, most effective approximation possible.

Usually, humans desire to interact with the model, in one way or another: influence the system or get a glimpse of what is going on. This is achieved via a View layer. Since the business rules (Model) change far less frequently than the user interface to the system (View), there is, often, a requirement of being able to change View without disturbing the Model. The requirement can be satisfied by decoupling Model and View through the introduction of a Controller. This brings us to the infamous Model-View-Controller (MVC) pattern.

If we could just start-up an application in-memory and guarantee that it always stays there, the above would be as much as we would have to worry about. Alas, that's not the case. We have to periodically (or constantly) backup a snapshot of the system's state into some kind of persistent storage. This way we can restore the state from the backup, if needed, or share it with others. The motivation and mechanisms, for the persistence, can be numerous and different but it is, almost, always necessary.

In fact, the persistence is so important that some people begin with the design of the persistent storage (e.g. DB tables) and end-up with an Anemic Domain Model and a separate "Service Layer" consisting of queries to the persistent storage. Martin Fowler et al. have identified it as an anti-pattern. Such tight coupling of the application code and the persistence one, makes it very hard to unit-test your application - makes application code less reliable and extensible.

Solution

One solution to the defined problem is to abstractly extract the concrete implementation of the persistence code out of the Domain Model. Basically: decouple the persistence from the application code. By decoupling, besides making our application much easier to unit-test, we will, also, make it more flexible - different persistent storage mechanisms (LDAP, DB, plain files, XML etc.) can be swapped-in on-demand, without affecting the application code and logic.

While we do this, we have a supplemental goal: we want to keep the implementation simple. One way of achieving the goal is to declare persistence as a dependency of a domain object. We can introduce a Manager interface that our domain object depends on for all its persistence needs.

Concrete implementations of Manager can be registered with the appropriate entities using Dependency Injection; so that the entity itself never needs to know the specific implementation used.

Sample Code

In this sample, we will look at a Blog entity. For the purpose of this demo, we will use the Context IoC introduced by Sony Matthew. The reason why we choose it over the Constructor or Setter Dependency Injection is to make example code simpler.

Let's look at the Blog interface. Please, note that the only addition to the interface, that would not be present in a "pure" domain object, is the declaration of the interface for the persistence dependency:

public interface Blog {

    public interface Manager {
        //-- The argument to the load() method is entity's PK
        public Blog load( String name );
        public void save( Blog blog );
        public void remove( Blog blog);
    }

    //-- The rest of the interface goes below
    // .....
}
Implementation:
public class BlogImpl implements Blog {

    private static Blog.Manager manager = null;
    public static Blog.Manager getManager () {
        return BlogImpl.manager;
    }
    public static void setManager ( Blog.Manager manager ) {
        BlogImpl.manager = manager;
    }

    public BlogImpl() {}

    private String name = null;
    public String getName() {
        return this.name;
    }
    public void setName( String name ) {
        this.name = name;
    }

    //-- Below go any other properties and methods relevant
    //-- to the Blog entity as a purely Domain Object.
    //.....
}
In the above example, the primary key of the Blog entity is the name property.

One of the manager implementations can have an implementation that looks like the following:

public class BlogManagerImpl implements Blog.Manager {

    public BlogManagerImpl() {}

    public void save( Blog blog) {
        //-- Save the state of the Blog object, into a database
    }

    public Blog load( String name) {
        //-- Load the Blog instance from a database.
        //-- e.g. using hibernate:
        //-- return (BlogImpl) session.load( BlogImpl.class, name ); 
        
        //-- this is just for the demonstration purposes
        BlogImpl blog = new BlogImpl();
        blog.setName ( name );
        
        System.out.println ( "Loaded blog: " + blog.getName() );
        return blog;
    }

    public void remove( Blog blog) {
        //-- Remove the persisted state of the object from the
        //-- database..
    }

}
and, finally, the following is how your application may use all of the above to load two blogs:
public class Main {
    public static void main(String[] args) {

        BlogImpl blog, blog2;
        
        Blog.Manager blogManager = new BlogManagerImpl();;
        BlogImpl.setManager( blogManager ); 
        
        blog = (BlogImpl) BlogImpl.getManager().load ( "John" );
        blog2 = (BlogImpl) BlogImpl.getManager().load ( "Joanna" );
    }
}

each call to the getManager().load() will load an entity from a database. For the purposes of this demo, it, also, displays a message.

Conclusion

Using the PDO pattern, we have extracted the persistence code details out of the Blog entity. This made Blog entity more object-oriented. By decoupling its dependency (a database, in this case) from the entity, we made unit-testing the entity much easier. Better unit-testing delivers more reliable, extensible code and significantly improves the overall design.

posted by irakli, 22:30 | link | comments

04/13/05

Find 10 differences


On the left - Emmanuel Cecchet - Chief Architect for ObjectWeb, on the right - Jean-Francois Arcand - Tomcat 5 Developer.

posted by irakli, 11:46 | link | comments

04/12/05

Tiger Countdown.

17 days left...
http://www.apple.com/

Mac OS X Tiger will be released on April 29 - now official.

posted by irakli, 07:06 | link | comments

Crashing Computer Programs

"A crash is when your competitor's program dies. When your program dies, it is an 'idiosyncrasy'. Frequently, crashes are followed with a message like 'ID 02', ID is an abbreviation for idiosyncrasy and the number that follows indicates how many more months of testing the product should have had" - Guy Kawasaki

posted by irakli, 06:57 | link | comments

04/10/05

White House Duck

Media (even international) has been covering that a duck made a nest in front (actually at the back entrance) of the White House and WH security built a fence for it, so that tourists do not bother the duck.

One good thing about living in D.C. -  you can walk down there and see for yourself  Which I did. Actually, I went for the Cherry Blossom but since  I was parked nearby gave a visit to the duck, too, on my way back. Here's a photo (sorry the duck was away at that time but  I saw her on my way to the Cherry Blossom - so the duck does exist ):


posted by irakli, 20:07 | link | comments

Cherry Blossom in Wash, DC 2005

Just couple of photos, for those of you who could not make to it:

 

posted by irakli, 19:25 | link | comments

04/08/05

Clustered JDBC and interoperability on the JDBC level?

TSS has recently interviewed Emmanuel Cechet  - the chief architect of ObjectWeb project. What seemed especially interesting to me is the part where he talked about C-JDBC project:

What is the clustered JDBC project?

Clustered JDBC is a middleware to transparently cluster databases. It means that you take your existing application running in whatever application server you like and it's kind of a smart proxy at the JDBC level that takes the query coming into the JDBC pipe and balances them on a set of back ends, database back ends and replicates those databases and providing high availability and scalability features by load balancing those queries and providing check pointing, backing up, JMX administration so that it can integrate within any application server environment or Java environment in general.

Why and when would an enterprise developer use this in their architecture?

Either they start from scratch and they just want to provide more reliability to their database and instead of having a single backend, especially for small solutions who are using open source products you just want to cluster the database and have a second replicate in case one fails, you have maintenance to do on the backend and each time you just want to scale the application then you have to add new backends to this cluster. Usages, if you have a main Oracle database and you want to make this database scalable, but you don't have the money to buy new Oracle license or a larger SMP machine, you can put a bunch of small open source databases on the site and make a heterogenous cluster of a main Oracle database and set up a virtual database to offload this main Oracle database. That can make a lot of sense to make the existing infrastructure to evolve and move smoothly to open source not by just replacing existing legacy databases by a cluster of open source databases but having a mix of heterogenous things and moving smoothly to open source.

Could you take Hibernate data application written using the Oracle dialect and plug in clustered JDBC, how would that work?

We use JDBCs to both Hibernate and we have demos available on the web site running with Hibernate and to handle the value SQL dialect, C-JDBC comes with rewriting that allows you to rewrite, for example Oracle specific queries into new queries that would run and execute on MySQL orPostgres or whatever databases you are on and we are also working on extensions to rewrite tools, which will talk to us and which are much more complex, not just single queries so that we can redefine work flow of queries that you would like to execute and also backend those.

posted by irakli, 06:25 | link | comments

04/04/05

Apple Sales People

As much as I love everything Apple (yes, it is an addiction and a lethal one) I can not stop "admiring" the level of stupidity of sales people at the Apple Stores. Well, as usual - most of them, of course - it is always unfair to trash people as a whole group, even if you are talking about Apple Store sales guys :D One good thing I can say about them - they still do not manage to suck as much as the Online Store morons, do :)

Anyways, yesterday I got fortunate to observe a very interesting conversation between a store employee and a customer. The customer was a hard-core PC guy, who, apparently, got interested in Macs and was wondering if it made sense for him. Well, if you have ever been to an Apple store, you know that it is hard to leave it untouched and if you run into a really motivated person who can bullshit you (heh) for 20 minutes - you are done. Now, the Apple Store employee girl was none of those (neither motivated, nor knowlegable) so the conversation was not going as well as it should have and I kept watching it (yes, it is unpolite) getting annoyed.

At one moment the customer asked if there was a popup-blocker available. The answer he got was "no, we do not need it because popups come from spyware and there is no spyware on Macs". Oh, God! First, popups do not come from spyware, second - both Safari and Mozilla/Firefox have popup blockers, OF COURSE! When the girl went on and suggested the poor guy that he should buy .Mac account because it comes with a free antivirus (well, THAT is really unnecessary) - my heart could not take that much and I left...

Duuuuuuuuuude, just because you have real cool sh..t does not mean that people who sell them can suck badly!

P.S. A friend of mine, recently, bought a new Powebook 15" and it appeared to be defect. When she took it to the service store, they told her - they are very surprised because, such thing has never happened in their experience. Give me a f...in break! :D Never? So, how long have they been there? Like one week? Ahhhhhhhhhhh


posted by irakli, 06:19 | link | comments

Which FM Transmitter for your iPod?

I have an iPod Mini and my car only has a CD-Player, no mp3 player. Also, a lot of my music is in AAC format, nowdays, as I became a regular on the iTunes music store. So, the obvious choice was to hook-up my iPod Mini to my car stereo. Since I do not have a cassette stereo (the car is too new for that archaism), I need an FM transmitter.

I first tried Griffin iTrip Mini, because it was soooo advertised. IT SUCKED. To set a channel, you need to install some stupid beeping "audio" files on your iPod. Changing a channel (which you may need often as almost all frequencies are used-up in modern cities) is a pain and that "audio" channel files get in your way all the time, causing stupid beeping in the middle of listening to your music. And yes - it managed to block the HOLD switch, so I could not use it any more while iTrip was plugged in. Overall - I HATED IT. I hated it so much - I gave up using my iPod as my car stereo.

Then, today, I got MacAddict AirPlay and I loved it! That's the way it is supposed to be! It does not block my Hold button, it does not need any installation (leave alone stupid audio frequency files), it has a screen which shows me current frequency used and if I will so - there are two buttons clicking which I can switch a frequency in just a snap! And the same model works with all iPods (regular, mini and even shuffle) - not true for the idiotic iTrip.

Awesome! Highly recommended.

posted by irakli, 00:09 | link | comments

04/03/05

Tungsten T5 rocks.

I've been wondering which handheld to get, for a couple of months, now. Windows-based crap is out of question, of course. I got rid of the Redmond parasites on desktop, why would I want it in my pocket? Unfortunately, Apple does not produce handhelds, any more. Neither do they show any sign to do so.

So I was wondering, mostly, about the choice between different PalmOne products: Zire, Tungsten and Treo. Treo has a huge advantage of being a smartphone - you can plug you SIM card in and no need for a cell phone! Both Zire and Treo have a built-in camera. Tungsten, on the other side, has the largest, the best screen, higher CPU and is very slick and sexy :)

Being an aesthetics freak, I went for Tungsten T5. Could not resist its cool look, Well, and, also - I do have a Nokia 6230 (which I have no intention to get rid of), so that, kindof, makes up for what Tungsen misses - I can connect Tungsen with my Nokia via bluetooth. I am using Nokia 6210 driver, though. Hope to find the proper one for 6230.

There are Wi-Fi extension slot for Tungsen and you can by a GPS package - GPS Unit, windshield-holder, car-charger and TomTom software. Considering that I already use TomTom (as a standalone car GPS system) and totally love its software - that sounds very good to me. I guess I am gonna buy the kit and get rid of the car GPS.

Almost forgot: Tungsen T5 is fully compatible with Macs, comes with the installation CD for Mac and lots of goodies on it. Well, not surprisingly - Apple store is where I bought it :P :)

P.S. There's IBM J2ME for Tungsten T5: http://www.palmone.com/us/support/jvm/ (it also runs on the latest ZIre and Treo, tho)

posted by irakli, 23:50 | link | comments

Interview with Jean-Francois Arcand

Jean-Francois Arcand, a Tomcat 5 developer has recently been interviewed by TheServerSide.. It is very interesting, overall, but there were several things that seemed strange to me.

I have not used "embedded" feature of Tomcat but the impression, from the interview, is that this just means there is an interface which allows you to control Tomcat from your application.

"Embedded" in the case of Jetty means much more - embedded Jetty is just one JAR and you can use it as one JAR; it is very small, in size, so you can really embed it into your application, without much overhead.

So, unless I misunderstood something, for the embedding (e.g. for testing purposes, using as a Stub) Jetty, still, seems much more convenient.

On the same subject, for me personally, it was alerting to hear that Jean-Francois has no idea about the embedding features in Jetty. That may not mean much but is odd. People who have tendency towards the re-invention of the wheel, do not usually invent good wheels. If you begin work on embedding feature and there is a product that has that figured-out, why would not you go and see how they did it? Maybe you won't do it the same way (most probably not) but at least - you should look into it, should not you?

Also:

I was really surprised by one comment from the interview. The question was if people should use Apache in front of Tomcat or run it as-is. Jean-Francois made it sound like it is just a matter of performance and almost suggested that Tomcat without Apache is just as good.

NOT TRUE.

Yes, Tomcat has gone long way in performance but that just proves the point that: putting Apache in front of Tomcat is not a matter of performance (performance may be the same) but _security_.

To make Tomcat listen to port 80 you will need to launch it under root user, which means your application code will also run under root. That's _evil_. User applications should never run with root privileges.

When you put Apache in front of Tomcat (or any other servlet engine/J2EE container, for that matter) your application can run under an non-privileged user. That's much more secure.

posted by irakli, 03:03 | link | comments


Copyright (C). Irakli Nadareishvili. Picktek Ltd.