Viser innlegg med etiketten java. Vis alle innlegg
Viser innlegg med etiketten java. Vis alle innlegg

onsdag 12. januar 2011

Java EE6 with GlassFish 3 Application Server review



Just got through this interesting book. It provides a quite nice perspective on a default set of tools for web application development in Java. Obviously focused on config and deployment of GF, the book also covers JSP, JSF, taglibs, messaging, security, ejb, cdi and web services. Althought all very familiar topics, it's nice to have a collection to point to for referencing these proven technologies. It should be pointed out that there are no comprehensive code appendixes in the book. So it's not bloated with code, but on the other hand it's not entirely clear how web services and messaging fit into the big picture.

The primary audience of this book is web developers wanting to move a bit towards the server side, learning how to integrate scalable data providers into their applications. I'll be recommending this book to a couple of web developers.

fredag 2. juli 2010

JavaZone 2010 accept

Great, two of my collegues at Computas and me got accepted each our talk for the JavaZone-conference in Oslo 8-9. september. The three of us will contribute with these presentations:

Geir A. Lund:
Erfaring med konvertering fra CVS til Mercurial i stort Javaprosjekt

Filip van Laenen:
Why We Should Start Tagging Our Code

Harald Søvik:
Enhance your Maven plugins with Groovy

Along with a small army of other experts and geeks, we will fill the venue with experience, knowledge and pure java-happiness for two entire days. Don't miss out on this event - it's probably the best java conference in this part of the galaxy :)

torsdag 22. april 2010

Java Microbenchmarking

Working late on preparing a performance test tomorrow, I stumbled over something called microbenchmarking. The idea is to put small performance tests within you code to evalute the system. This gives you the liberty of extracting performance measurements regardless of what environment the platform runs in (i.e. your development desktop vs. testing vs. production).

There are an awful lot of obvious (and perhaps not so obvious) things not to do while microbenchmarking. Consider e.g. if you should invoke any large or small load, what layer to stress, when to do this ..

I'm implementing this as a JBoss MBean, which will let me invoke a test suite with a HTTP request, and get a "ping"-style timer response.

I'll post my results later if this happens to be an interesting feature.

mandag 5. april 2010

NDC 2010 accept

Against all odds (?) - Mortens and my paper ("Modularization, Testing & Technical Debt in a Large Agile Project") was accepted for the Nordic Developer Conference 2010. Well then, even though it's experiences from a Java project presented at a .Net conference, both sides has the agile dimension in common.

But it's still somewhat comical to present in "the dragon's lair". The presentations is scheduled for day 2, track 2 at 11:40 - in parallel to Eric Evans .. yikes.

The abstract reads:

This experience reports focuses on the major scrum–related technical challenges that arose during a 120 000 hour scrum controlled project. For each of them, we try to identify the cause and the consequence, and then follow up with any solutions we tried. Finally we sum up and assess whether the problem was successfully solved or not.


In addition, my colleague Filip van Laenen was accepted with his presentation "Distributed Computing 2.0". See http://www.ndc2010.no

torsdag 17. desember 2009

Java 7 chapter 4: client and web changes

XRender
Old Java2D had to do a lot of rendering in software. This was fixed, but with OpenGL and poor Linux drivers, it can still be a problem. Thus, an X11 renderer should be created. Java2D is used by Cairo, GTK+, QT4 and KDE4.

Deployment features
Enable better access to installed JREs for applets, webstart and javafx applications. Also seamless JRE installation, and single line javascript deployment.

Swing updates
Translucent and shaped windows, heavyweight/lightweight mixing, and the improved AWT security warning.

JXLayer (glass pane overlay, control everything) component decorator, JXDatePicker, and possibly CSS-based styling.

DROPPED: Swing Application Framework to make it easier to write applications. May provide co-existence with JavaFX.

Nimbus look and feel. JGI.

Web changes
Upgrade the JAXP, JAXB, and JAX-WS APIs to the most recent stable versions.

onsdag 16. desember 2009

Java 7 chapter 3: core

Modularization
JSR 277: JAM module system eller OSGi. Applying JSR 294 to the rt.jar, creating virtual machine “profiles”. The core has been reduced from 15 MB to 5 MB. There might be profiles for headless, rich apps, realtime ..

ClassLoader architecture
Modifications to avoid deadlocks in non-hierarchical (cyclic) topologies.

Close URLClassLoader
Often in use by application servers. When a new URLClassLoader is constructed, the old one can be garbage collected when there are no references to this object. Only then can files and directories under this CL be unlocked. Because of the nature of GC, it is unpredictable when this will happend. A close method will make this behavious more predictable.

Unicode 5.1
Standard for representing various characters, now supporting even more characters.

Concurrency/collection updates
166 is a package of different concurrency stuff. 166y is defining a fork/join-framework (Parallel Array). Operation on a collection of elements, like incrementing a number across an array.

New I/O APIs
A file system interface that supports bulk access to file attributes, change notification, tunnel to FS-specific APIs, service-provider interface for pluggable FS implementations.

Asynch I/O operation on both sockets and files. Socket level UDP stuff.

EEC
Approac to public-key cryptography. Now supported with a native java library.

tirsdag 15. desember 2009

Java 7 chapter 2: Language changes

Annotations
Annotations is limited to declarations in java 6 (method parameters and the declarations of packages, classes, methods, fields, and local variables). This jsr extends the annotation system to use on any type. It is limited to defining the syntax of the extended annotations, leaving the semantics out.

Modularization
Will promote testability and maintainability. Much like OO and interfaces, but at larger scale. A JAR is like a module but does not define dependencies. All classes are put on classpath, which enables interface type checking at compile time. However, the classpath can be different in runtime, i.e. different or multiple library versions. ClassLoaders can be used to segment the classpath, but they are hard to use. OSGi is a module system. It uses metadata in the manifest-file to determine inter-jar dependencies, and provides one ClassLoader per library. OSGi is a specification with several implementations. Project Jigsaw is the effort of modularizing the jdk itself. It will introduce a “module” keyword which combined with maven/ant-style dependencies can be used to create runtime module dependencies.

Coin
Project Coin defines a set of small language changes should be added to JDK 7. Seven features have been selected:


  • Strings in switch
  • Language support for collections
  • Automatic Resource Management
  • Improved Type Inference for Generic Instance Creation 
  • Better integer literals
  • Simplified Varargs Method Invocation
  • Language support for JSR 292


See i.e. http://blogs.sun.com/darcy/entry/project_coin_final_five



fredag 4. desember 2009

Java 7 chapter 1: The Virtual Machine

To prepare for the arrival of the Dolphin, I will indulge in some research entitled "What's new in Java 7". The story will consist of 5 chapters: the vm, the language, the core, the client and the Web. First came the change to the virtual machine.

CompressedOops
OOP is an “ordinary object pointer”, and it’s length is usually similar to the length of the native operating system pointer. Increasing the length from 32 to 64 bits will cause the heap in a 32-based program (running on a 64-bit system) to expand by 50%. Memory is cheap, but bandwidth and cache is expensive, and it is should not be very costly to port applications a new platform. Using a 64 bit vm and the UseCompressedOops flag will keep addressing overhead similar to that of 32 bit systems at the cost of cpu cycles.

Garbage First GC (“G1”)
Replacement for Concurrent-Mark-Sweep GC, but still “generational”. CMS divides memory into young generation (eden, survivor) and and old generation. Move live object into a more “persistent” generation. Stops the world to do complete collections. G1 divides memory into small “regions”, and these are labeled “young” or “old”. During a GC, those objects who are “live” in a region, will be compacted with other “live” objects in another region, depending on their age. Each region has a “remembered set”, which contains all external references to this region. This reduces the need to pause the world to mark.

G1 is a server-style garbage collector, targeted for multiprocessor- and large memory systems. It aims at being more predictable than CMS. It’s also available in 6u14.

JSR 292: The Da Vinci Machine Project
The JVM should be extended with general support of languages other than Java, and in particular dynamically typed languages. Such language implementers have observed a range of painful aspects of the byte code language, and this projects aims to remove those in a general manner. The noteworthy suggestions is: dynamic invocation, continuations, tail-calls and interface injection. The JSR specifically targets dynamic invocation and hot class modification. Today dynamic languages produces a lot of different options for signatures that all have to be stored in permgen space. This is very inefficient, and one should be able to narrow down these options at runtime.

fredag 13. november 2009

Twitter programming session

Last night I had a live programming session with ~30 CS students at the University of Oslo. The goal was to show how easy it is to interact with RESTful webservices in Java. I started out with explaining about HTTP and Jersey, REST vs SOAP, JSON vs XML and jsonlib vs jaxb. Those were the major design decisions.

I subsequently implemented a bot that would befriend anyone that was following the bot. Doing this with jsonlib was pretty straightforward, but showed the weakness of not having a higher level abstraction of the domain. Therefore, the next bot would get status updates from his friends timeline, and show them in a simple GUI. This proved a lot smoother when jaxb was at work, because it created two separate layers: one interacting with twitter restful webservices, and another showing model objects in the GUI. Last I showed a bot that used twitters search api to follow a trending topic.

Overall it was a good session, but I think it was a little bit too packed with technology choices. I guess it would have been of greater value to just show the magic of jaxb, and skip the primitive alternative.

The javabots is available for download at http://bit.ly/FyeqT for a while.

fredag 11. september 2009

Speeding up the development cycle at JavaZone

JavaZone 2009 has come to an end. It was a top notch conference: Great speakers and free beer.

My contribution was a lightning speed with entitled Speeding up the development cycle: Stash your files on a Solid State Drive

The abstract reads: Solid state drives have recently become easily available. Their performence may provide a way of reducing the time spent on on the development cycle: compiling, packeting and deploying applications. This paper shows promising results by locating the code base and local maven repository on a solid state drive. Initial experiments shows that time spent on waiting for your code to compile may be reduced by 50%.

You can get the slides at: http://www.slideshare.net/harals/ssd-dev