Archive for the ‘java’ Category

Threads don’t scale? They might do now!

Friday, March 7th, 2008

One of the interesting things in this industry is that every once in a while you have to completely re-evaluate your beliefs in light of new developments. It’s long been common sense that thread-based servers scale worse than selector-based poll/NIO ones.

This certainly was true at one point in time, but it seems it may not be true any longer. There’s several reasons:

  • Modern threading libraries seem to have greatly increased the number of threads they can run.
  • Locking/synchronization is now orders of magnitude faster and can sometimes even be optimized away by the compiler.
  • Threading libraries are much better at context switching sometimes eliminating them completely (why switch in a thread I know is waiting for I/O?) and having constant time schedulers (context switching doesn’t get more expensive the more threads you have).

It’s funny that while the whole industry was learning how to do designs for non-threaded models there was this group of people fixing up the actual infrastructure itself.

Time to pick up Doug Lea’s threading book again. Maybe this reading I will understand some of it.

Sun on Rails

Friday, September 8th, 2006

Sun investing in JRuby is very cool. Having a Java implementation of Ruby isn’t a big deal for me but there’s two other reasons it makes me excited:

  1. Having a second implementation of a language is several times better than having just one. This second implementation will force Ruby to grow up. It may finally acquire some level of formal specification and it will require Ruby to move in a much more stable and planned way than before. This is going to be crucial as more and more start betting their businesses, jobs and careers on the technology.
  2. Is the Sun finally about to rise? I’ve seen several indications of Sun’s dynamism of lately. From cool hardware to making the right thing about it’s software line (Java and Solaris). Personally I don’t care whether Java is open source or not, but Sun should! Sun is a hardware company, moving towards their core competency while having a good plan of how to handle their peripheral offerings is going to be crucial for Sun to get their balance sheet back into black. Time to make a long-term investment in SUNW while it’s on the cheap?

I would not be surprised if we see a similar move from Microsoft soon. I mean, who doesn’t want to be on the marketing bandwagon and hype of the century (only 6.5 years into it but nevertheless).

Beginning of the end

Friday, July 14th, 2006

Oh great! Struts support!

Could this be the beginning of the end for the IDE that single-handedly pushed development environments further than ever before?

:-(

Java and Ruby philosophers agree

Monday, January 16th, 2006

Regarding my last Ruby post: Incidentally constants aren’t all that constanty in Java either. Bummer. Isn’t there any safety in this world!?

:-)

Here we go again…

Thursday, December 15th, 2005

Bill Roth (BEA manager of something) blogs about SCA:

What is SCA?
SCA is a specification that allows developers to focus on writing business logic.

Pfhahahahaha!!

I’m almost falling of my chair. How many times have I seen this or that technology touted with those words? And the result always being a much bigger mess than it was before. COBOL was one, and I’m telling you the ratio of business logic to cruft in the millions of lines of COBOL out there is embarrassingly low. Then came the 4GLs, and well, anyone that had to maintain an Oracle Forms or PowerBuilder app knows that it sure isn’t just about business logic. EJB was also sold this way, and we all know what happened to that.

Then it got me thinking…

Despite the vast amount of historical evidence, why is it so damn hard to get this right? There’s something to this insightful article by Nat Pryce. There is so much complexity in software relating to fighting paradigms, a patchwork of differing technologies, crufty code hacked together 3am before an important demo. I just love Nat’s parallel to modern day London. I used to live at one end of Bishopsgate in the City of London. Just walking the ten minutes down the street to London Bridge would expose you to neo-classical buildings, the odd surviving victorian (I lived in one), art deco, 21st century glass and brushed steel skyscrapers. With you walking would be Sikhs in their turbans, blonde (and drunk) scandinavians, moslem women in burkas, machissimo italians, gay couples (excuse the stereotypes, I think you get my point).

London may not be beautiful in the classical sense of the word, but there is certainly something very special about it.

Maybe it’s the same with software…?

Gavin King killed Prevayler

Friday, November 18th, 2005

The topic of Prevayler has once again popped up on javablogs.com so I’d thought I’d just give my current opinion on the subject.

Prevayler caught my interest about three years ago. I had written a couple of systems with EJB and was quite disillusioned about that particular technology. I was just starting a new project at Lecando and we were completely reevaluating our technology stack. The state of O/R-mappers in Java land was pretty sad back then. We tried out both OJB and Hibernate and neither of them were even close to acceptable quality. Both of the commercial options were ridiculously expensive so we didn’t even consider them. So we were about to do what most other projects did back then, write our own. Again! One morning one of the developers discovered Prevayler and we thought: what the heck, let’s give it a try. We had very good test coverage and were confident that we could replace it later down the line if needed too.

It was great! Not only was the performance amazing it was also incredibly productive. Prevayler wasn’t completely without it’s problems but we worked them out. The backsides of Prevayler are well known: it’s basically single threaded which means you can’t do any blocking I/O inside a Prevayler transaction and the data sizes you can use are quite limited (in practice a few 100 megabytes is the limit at the moment), there’s also the “Prevayler baptism problem” which affects how you code things a little bit. We understood all that and for the app we were writing we could live with it. Prevayler isn’t for everyone but it worked out well for us.

But the O/R-mapping landscape for Java didn’t stand still. Martin Fowler and David Rice published their patterns around O/R-mapping and of course Gavin King stepped up to the plate.

…and completely changed everything.

Both Hibernate and Rails’ ActiveRecord are today incredibly easy to use, productive and free. In fact they’re so easy to use and productive that there is very little need for Prevayler anymore. As I mentioned above there are some issues with developing and designing with Prevayler and of course there are some issues around O/R-mapping as well. With Hibernate/ActiveRecord you need to decide how to do your outer join fetching, how to set up your indexes and sometimes you might need to do some denormalizations. Hibernate can handle almost every performance problem I’ve seen within the framework where as in ActiveRecord you need to fall back on custom SQL on rare occasions. So there are issues around coding with both Prevayler and O/R-mapping but the advantages with O/R-mapping are pretty obvious: it can scale to almost any dimensions both in terms of load and data sizes.

So, Gavin King, you killed Prevayler. That’s fine, you did also change the world. (If you just wouldn’t be so incredibly smug about it. ;-) )

While we’re on the subject of IntelliJ…

Thursday, November 17th, 2005

IntelliJ 6 is going to ROCK!

Check out the roadmap.

Just a couple of nibbles:

Build and Continuous Integration Server:

  • Instant notification
  • Navigate to failed tests in IDE
  • History, statistics
  • Delayed commit: build and commit if successfull

Collaboration:

  • Warn if simultaneous editing causes merge after commit.
  • Collaborative code review: auto-follow-me navigation
  • Project portal

OMFG! Prague is back on the map for total world domination!

IntelliJ IDEA loves Spring

Thursday, November 17th, 2005

Have you guys seen this?

Autocomplete properties for Spring in IDEA

IDEA can auto-complete properties for Spring configuration files! Pretty amazing!

The world is a crazy, crazy place

Wednesday, November 16th, 2005

Proof: A guy that enjoys to express himself in extreme profanities and insult his friends hard work is now going to control the future of Java.

That’s just fantastic. Can we have a JSR for “asshat”, please?

BEA taking interest in Ruby on Rails?

Monday, November 7th, 2005

BEA just released BEA Workshop 3.0. While this is completely uninteresting to me the
this blog entry
from the VP of the BEA Workshop Business Unit did catch my eye:

After several years of working with these languages, it became clear there had to be an easier way to build web applications. It started with CGI scripts written in Perl, which gave rise to PHP. Python, one of the first OO scripting languages was given new life by this new paradigm. There are also new languages on the horizon generating great interest, Ruby.


It is safe to say that no one can predict what the next hot framework will be, but our new strategy allows us to be ready for it.

I guess it’s just a matter of time before the big guys gets an interest and actually starts investing in this. BEA has always been quick to catch on to what’s hot and trendy in the industry. Technically it wouldn’t be too hard to run a Rails app inside Weblogic all that’s really needed is a good enough FastCGI implementation (shouldn’t be too hard to beat Apache). Maybe a session store implementation that hooks into the existing Weblogic session fail-over infrastructure. An ActiveRecord connection that uses the Weblogic connection pools (with full 2pc support). Not rocket science directly.

This is only mildly interesting. What would be seriously cool though is if someone put some serious money behind an integrated development environment for Rails. Building refactoring support and other stuff for Ruby is really hard and would require some real investment rather than some open-source faffing about in the closet.

In a way I’m a bit afraid. The big guns entering the arena is going to completely change things. For the better or for the worse?

A bit of both I guess.