Live life to the fullest

my random thoughts and stories

Archive for the ‘Java’ Category

Jarvana: Tools yang Mempermudah Hidup Java Developer

with 4 comments

Seberapa sering anda menemukan NoClassDefFoundError pada saat sedang develop aplikasi. Mungkin anda memakai library Hibernate tapi lupa menyertakan library lain yang diperlukan oleh hibernate sehingga muncullah error kedua termasyhur[1] di seantero dunia per-JAVA-an. Bingung jar apa yang berisi class yang disebutkan oleh error stack trace? Biasanya apa yang akan anda lakukan adalah copy paste nama class tersebut di search bar google dan.. ENTER. Kalau anda sedang beruntung maka anda akan mendapatkan nama jar yang dicari. Tapi kemungkinan untuk mendapatkan nama jar tersebut mungkin hanya 50%[2].

Kini ada tools online berupa website yang dapat membantu anda menemukan file jar yang anda butuhkan. Website tersebut adalah (red: selanjutnya kita panggil dengan sebutan Jarvana). Jarvana sendiri diperuntukkan bagi pengguna Maven ataupun Ivy, tapi tidak tertutup kemungkinan pengguna Ant murni (tanpa Ivy) juga dapat mengambil keuntungan dari kehadirannya.

Pada tampilan utamanya Jarvana menyediakan fitur pencarian berdasarkan nama class, project, dan content. Pencarian berdasarkan nama class memudahkan user dalam mencari maven project yang menyertakan class yang dimaksud. Ketikkan kata kunci semisal “beanutils” di textbox input untuk nama class dan tekan Enter. Anda akan disuguhkan dengan hasil pencarian berupa tabel, lengkap dengan pagination untuk membatasi jumlah hasil pencarian per halaman. Kemudian anda dapat menelusuri class yang sesuai dengan yang anda cari, dan klik pada nama class untuk melihat detil dari class tersebut. Di awal tampilan detil anda disuguhkan kode yang perlu ditambahkan untuk menggunakan file jar tersebut di project Maven ataupun Ivy. Selain itu untuk yang menggunakan Ant (tanpa Ivy) dapat mengunduh file jar yang dimaksud di bagian “Archive Information”. Di bagian bawah dari tampilan detil tidak lupa Jarvana menyajikan beberapa informasi penting seperti: signature method dan constructor, class yang di-import oleh class ini, dan yang tidak kalah penting versi class hasil kompilasi untuk mengetahui dengan java versi berapa class ini dikompilasi.

Pencarian berdasarkan project memiliki kesamaan dengan pencarian nama class. Perbedaan terletak pada tampilan detilnya. Pada tampilan detil untuk project Jarvana menyajikan data file jar seperti: jumlah file class di dalam file jar, jumlah folder, jumlah file selain class, dan juga nilai checksum (MD5, SHA1) dari file jar tersebut.

Pencarian berdasarkan content memungkinkan untuk mencari berdasarkan kata kunci yg muncul di jenis file tertentu, semisal: html, java, jsp, pom, xml, atau bisa juga kita pilih semua.

Kesimpulan: Java developer semakin dimudahkan dalam melakukan development dengan adanya tools ini. Dengan kehadiran Jarvana semoga NoClassDefFoundError tidak lagi menjadi momok yang menakutkan. Akhir kata “Happy Coding”.

[1] Disclaimer: Klaim tentang kemasyhuran NoClassDefFoundError hanya berdasarkan keisengan penulis. Tidak ada data apapun yang mendukung klaim penulis
[2] Disclaimer: Klaim tentang prosentase keberhasilan pencarian nama file jar berdasarkan nama class juga tidak berdasarkan data tertentu dan hanya berdasarkan perasaan perut dari penulis


Written by jecki

April 18, 2010 at 11:59 am

Neal Ford in JAX Asia 2007

leave a comment »

Last Thursday I went to JAX Asia 2007 conference in Ritz Carlton, Jakarta. It’s part of worldwide JAX conference talking about Java topics in trend. There were three speakers at this conference: Chris Anasczyk (IBM), Neal Ford (ThoughtWorks) and Thilo Frotscher (Independent Software Architect). I will only talk about Neal’s session here, since I was very inspired by his presentation although the other two guys are also good speakers.

The session starts with Neal giving tips on ’10 ways to improve your code’. He talked about several things which we all may have heard like version control, continuous integration but some are deeper like ‘prefer composition over inheritance’, ‘single level of abstraction principle (SLAP)’, ‘kill the sacred cow’. What I got from this session is we have to have discipline in Coding, be creative and not doing things blindly because everybody else do it.

The second session from Neal was ‘Introduction to JRuby’. He point us to how Ruby is different from Java, and how powerful it is. Everything is an object in Ruby. I think that beats Java right in its heart since Java always being claimed as an Object Oriented Language but has primitive which make people wonder how Object Oriented it is. Ruby is actually older than (or have the same age to) Java, but haven’t get much attention prior to Ruby on Rails (RoR). It is RoR which brought the momentum and lifted Ruby up to its popularity nowadays. For that reason Sun and Microsoft has put quite an effort to build an implementation of Ruby on each of their widely known platform, Java and .NET. JRuby was created as Ruby implementation purely written in Java. With JRuby one can get the flexibility of Ruby with the power of Java in his hand. I asked a question regarding Ruby’s feature ‘Open Classes’ which allow one to add new methods, attributes later on in other place. In my opinion this powerful feature will raise problems in the hand of undisciplined programmer. Neal answered that this problem will raise in every language. It depends on the developer. Neal also boldly state that is why we need unit test.

The third session was ‘Rails for JRuby’ showing us how Rails can run on top of JRuby. In fact we can use several Java’s feature, such as Distributed Transaction and numerous backing library, to strengthen Rails. There was also Rails demo which shows how easy web development is using Rails compared to Java’s programming model.

I have to admit that I am very impressed with Ruby since that day. I kept promising to myself that I have to learn this language as my secondary language and probably as my primary language in future. Since several big companies have invested dollars in Ruby it might have a bright future. I will start to learn ruby and write a journal on every experiment I make. So just wait for my upcoming Ruby experiment.

Written by jecki

December 7, 2007 at 11:17 am

My Preferred Java Web Development Tools

with 3 comments

Here I try to list several tools that I think I’d love to use (in the sense that I haven’t used some of them) to develop a web based java application.

Source Code Management

Build automation tools

Core Frameworks


Servlet Container

Issue tracking

Written by jecki

April 17, 2007 at 4:27 am

Posted in Java

Tagged with