Change of address

April 19, 2010

This blog has a new home at http://www.aloshbennett.in/weblog/. While the domain is a work in progress, all future posts will be at the new address.

Your feedback/suggestions are welcome.

~Alosh

Advertisements

Java EE 6: What’s new?

April 13, 2010

Here’s a concise white paper on what’s new with the latest release of Java Enterprise Edition. I recommend reading it.

And here’s a jist of things:

  • Web Profiles – For the light weight web apps where you don’t need a full blown container.
  • Servlet 3.0 – Annotation based, with support for web fragments and asynchronous processing (AJAX just got better).
  • JAX -RS – Restful web services are here.

(read more)


JavaFX: Coming of age

March 31, 2010

When it comes to web pages, I like them plain and simple. Earlier associations of flash and other embedded content with irritating ads and browser crashes makes me cringe when I hear “rich media”. Ajax was refreshing with its unleashing of the hidden powers of CSS and javascript.

But you got to face it. You cannot ignore RIA anymore. If you are going the RIA route, what options do you have?
Flex has been the industry favourite. But again, here’s reasons why (from Adam Bein’s blog) JavaFX is a good option too.

Take a deep dive!


Java Tech Days 2010

March 25, 2010

This being the first tech days post Sun’s acquisition by Oracle,the event started with a keynote from Oracle underlining their commitment to the development of java technologies. Lets jump into the highlights of the last 2 days!

  1. J6EE – This has been the biggest news on the horizon. While J5EE was about cutting the flab in JEE with JPA replacing container managed entity beans, J6EE made the stack much more easier to develop on. The following are the technologies that makes up the Enterprise Edition:
    1. Web Profiles – For the light weight web apps where you don’t need a full blown container.
    2. Servlet 3.0 – Annotation based, with support for web fragments and asynchronous processing (AJAX just got better).
    3. JAX -RS – Restful web services are here.
    4. EJB 3.1 – The business interface are optional now. Also, check out the EJB Lite.
    5. JPA 2.0 – Enhanced JPQL (java persistence query language), metamodel based query support.
    6. Context and Dependency Injection – Standardizes dependency inject in EE applications with seamless lifecycle management of the web beans.
    7. JSF 2.0 – Brings annotation support and templating of facelets.
    8. Bean Validation framework – No more writing validation code in the model. Annotate and forget it.
    9. Connector Architecture 1.6 – Standardizes bidirectional connectivity between the application and Enterprise Information System (EIS).
    10. Packaging Enhancements- Forget the ear files. EJB goes into a single war along with your web apps.
    11. and a lot more!
  2. JDK7 – Modularity and Closures are the buzz words for the new release expected any day. With a lot of new scripting languages out there running on the JVM, Closures does some catching up. Also with the multi language support, you can now pick your favourite from over 200 languages and start coding for the jvm!
  3. Bundles – Bundles is the way to go and that cannot be better emphasized with JDK7 introducing modules as a part of the language. The focus on OSGi and its support in GlassFish V3 could be java’s way of admitting its superiority when it comes to modularity. Go OSGi!
  4. Support for jvm based scripting languages – Groovy, ruby, jython, scala, closures, lisp, jcl .. The list is endless. There are more than 200 languages that are now supported by the jvm.

You can find more about the Tech Days 2010, Hyderabad edition on Arun Gupta’s blog.


ubuntu one

July 31, 2009

I guess many people were asking for something akin to Windows Skydrive. Ubuntu recently rolled out ubuntu one, an OS integrated online storage space.

And the first impression – its annoyingly simple to use. Once you are through with the two-click installation, you are left with just a “Congratulations” message.

First thing any linux user does is, right click the taskbar applet to check for Preferences. Well? Sorry folks, nothing to tweak around with. Disappointing 😦

Next thing, you click on the taskbar icon and it opens up an Ubuntu One folder on your home drive. With some relief, you then proceed to examine the folder for some sort of Nautilus extension to synchronize the drive. Nothing!

With mounting suspecion, you copy some files into it. Bloody hell!  Ubuntu One kicks into action staring synchronizing your drive.

Good  stuff: It optimizes on the bandwidth idle times to ulpoad the content in a very transparent way (means, over a slow connection you will not feel much of a drop in your surfing speed)

Bad stuff: It keeps spinning my hard drive like crazy. I hope they read blocks into memory, work off that and leave my hard drive alone! And we need a Preferences menu, to specify the location of the synchronized drive and tweak around with bandwidth shaping.

Verdict: The product is in its beta. If you are one Jaunty or Karmic (God bless you), what are you waiting for? And oh, the free version gives you 2 GB.

Update: What I thought to be heavy harddisk read was a bug in the 2.6.28 kernel around cpu fan speed control, causing the temperature to rise.


Jaunty Jackalope

July 27, 2009

Of late, there isn’t much going on at ubuntuforums. For a second there, I thought Ubuntu was losing steam. But then it occured to me how mature the OS have become from the ‘warty’ days. Not many creases to be ironed-out.

If you haven’t tried Jaunty Jackalope yet, give it a shot! The boot time is damn impressive!


compound-assignment operator and type casting

September 13, 2008

We’ve been learning since we first printed “hello world” that

i += 1

expands to

i = i + 1

Well, here’s a little problem to shake the faith.

byte i = 1;

i  = i + 1;

System.out.println(i);

Being java programmers worth our salt, it wouldnt take much to identify the compilation error.

Error: Possible loss of precision

So how do we explain that the next code snippet prints the value 2?

byte i =1;

i += 1;

System.out.println(i);

Here’s the secret: i += 1 is not same as i = i + 1

When you do an assignment (the first code snippet), java enforces type checking because the LHS and RHS may very well be independent of each other.

But the compound-operator is more like an incremental operator. The += modifies the value of the variable involved, rather than assigning a new value to the variable. When you modify a byte, you expect a byte as the result. To make life easier, java does an implicit type conversion for compound-operators because they are modifiers.

Have fun!