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.

10/31/04

ORM or not to ORM

This was also posted at: http://www.theserverside.com/news/thread.tss?thread_id=29140#144480

The lengthy discussion, at that thread, itself - shows that this topic is not a simple one and there are plenty who take one or another side.

The liberals say: "it is a matter of choice and depands on what are your goals in a specific project"

Is it,really?

For me, there are two major criterias to assess the quality of a program code
1) (Almost) No code duplication
2) Shortest source code providing the same result.

I do beleive that these are not just my personal choices. I think those two criterias have proven to indicate to a reusable and maintainable (!!!) code.

Do not forget - the life of a code begins ONLY after it is deployed to the production environment and you have to maintain it! Until that - it's all jokes and fun. That's when the real thing begins and when it starts to HURT.

Thesis: Maintainability and Scalibility are the key!

So, then why do I hate SQL in my code? Because, working in Java - my business logic is object-oriented. You can _not_ create a well-designed Java application which is not OO. OK, my business logic is OO but then - I need to use SQL??? But all these data-models and queries that I need to construct separately - THEY DUPLICATE MY OO LOGIC!!! That's code-duplication! Also, I do have to write all that SQL manually, even though I already have the same in my Java code, so source ain't gonna be the shortest! And - every time I change my Java code, I need to change SQL queries and table structure, too. Damn!

Who will argue that this does hurt both maintainability and scalability?

How do I modify my code with Hibernate? My persistence meta-information is in XDoclet form right in my Java-code. I do not write anything extra, outside the pure Java code. When I change something in the Java-code, I run my nice ANT task, which goes through the changed persistence configuration (auto-generated using XDoclet) and using Hibernate Schema Update, does ALL the necessary changes in the database. All I do is: type "ant database".

For me, a Java architect, Database is a persistence layer. Why should I have Business Logic (!) in a persistence layer? I don't want to know ANYTHING about my persistence layer, except that it stores data persistently. My business logic should have NOTHING to do with it!

This is why I would hate to see SQL in my Java code and as far as my thesis, above, holds - I can not be wrong.

But DB-centric advocates, also, have a "winning" argument, don't they? What was that - "PL/SQL provides better performance"?

Well, we have worked with it, ok? :) PL/SQL can be damn slow, too! So there is no win - any DB access, via ORM, direct SQL or PL/SQL can be slow enough (usually is) to be too slow. That's why we have cache layer.

Well, good news - my ORM framework - Hibernate allows me to integrate different cache frameworks (from JBossCache to the wonderful - Tangasol Coherense) transparently. So, I do not have to worry about that, either, do I?

And in addition to all these - I can get RDBMS-independance, if I am careful enough. If my client suddently decides Oracle is too expensive, or new client comes that needs MySQL - here we go - I just smile slightly and say "sure, no prob!".

Does not that feel great?

And last but not least - Nobody is trying to diminish the importance of SQL! ORM tools are using SQL behind the scenes - that's what they do and I beleive Hibernate is the most popular exactly because Gavin made it as SQL-friendly as possible. But it needs proper usage, that's all!



posted by irakli, 14:32 | link | comments

10/18/04

SilkTest - do not ignore!

Just stating the obvious (unfortunately missing with us, and not only us, I am sure): Code Refactorings should be happening constantly, they can not be something that is scheduled or aligned with a process of QAing - waiting for manually retesting system after each change. Refactoring should happen every day, lots of times per day. There is no other way to the quality code. But how do we make sure refactoring does not change (damage) the existing functionality? TESTS.

We are all more or less clear the JUnit tests is one part of the tests to be written but the functional testing should also be automated. No way it can happen manually as frequently as it is needed! So, big deal! There are tools for that, too. Like this nice one:
http://www.segue.com/products/functional-regressional-testing/silktest.asp

The thing is not to ignore these tools and use, usE, uSE, USE them for God's sake! :(




posted by irakli, 07:01 | link | comments

10/06/04

To Mac or not to Mac

At the border of two spaces or why is it dangerous for your health to switch to a Mac after years of (un)successful experience on a PC/Windows:
http://perseus.franklins.net/whymacssuck.wmv

P.S. Thanks to Andrew for finding this and to Doug for sharing it :)


posted by irakli, 12:39 | link | comments

10/03/04

Don't bug me!

The mailinator has been making my life on the Web more pleasant, for a long time, now. Here comes the second nice creature: http://bugmenot.com/, which I've learnt about from Doug's Blog. Thanks, Doug!

posted by irakli, 08:46 | link | comments

PHP + Java integration

I am getting more and more inclined to think that an idea of successful, pure-J2EE architecture is like Communism - too good to be true. To implement a perfectly designed J2EE architecture (assuming it can be designed as such) a perfect imlementation team is needed. Do we ever get such? And if we do - does not it cost too much?

I guess the point here is to simplify. Simplicity has long been known as the best choice. Java front-end is not simple - oh, NO! We all know what is simple and best - PHP. It's not so theoretically, it has been proved by years of successful experience of the immense amount of people. But.. PHP does not have enough muscle, Java does. So, why not use each of them where they are at their best? PHP - Frontend, Java - middle tier. Especially that JCP is already looking into it:
http://www.jcp.org/en/jsr/detail?id=223

The only question is - is PHP ready for this? I am not sure.

Well, maybe in the next project :)









posted by irakli, 08:20 | link | comments


Copyright (C). Irakli Nadareishvili. Picktek Ltd.