Posts Tagged IDE

Developing a plugin for IntelliJ IDEA – some useful tips and links

Tags: , , , , ,

When I started thinking about writing my first plugin for IntelliJ IDEA the biggest problem was lack of good and comprehensive guides how to do it and how to do it well gathered in one place. So this post will be a written collection of my personal experiences, links and other resources I found useful and noteworthy in my road to releasing Share with Pastie plugin to public IntelliJ repository.

Links

Before starting writing your mind-blowing and super-extra-useful plugin you should first do some reading. Below there is a list of places worth visiting:

Getting Started - a place where you should start. The most basic introduction to creating new plugins.

Basics of plugin development – second page similar to previous one but some interesting knowledge can be found there.

Continue reading this post …


Be Sociable, Share!

Share with Pastie – my first plugin for IntelliJ IDEA

Tags: , , , ,

When I started working for a new companyy I also changed my IDE so since June I am using IntelliJ IDEA. And I can undoubtedly say that it is worth every penny or Polish Zloty to be more precise :) It is more stable than Eclipse and it has many well supported extensions which are working out of the box without any, really ANY issues.

But this is not a post about greatness of JetBrains product. Since we all are working remotely (max distance between developers is about 650km) we use plenty of tools which allow us to collaborate, communicate and share ideas through the Internet. Skype, GoogleDocs, Planning Poker, tinyPM, company wiki are all among them. But one thing we are doing a few times each day is sharing code fragments online. When I have problem, I post code so we can talk about it, when I have an idea how to solve something, I post code to other team members and they can say whether my solution sucks or rocks. Mostly we share code using Pastie.org service.

Continue reading this post …


Be Sociable, Share!

My first TDD or why NetBeans sucks

Tags: , , , ,

This week was very intensive in terms of education. First, a three-day training about Test-Driven Development at Pragmatists, then presentation about Vaadin by Bartek Kuczyński at Warsaw JUG meeting.

However, in this post I will focus on the most interesting thing, Test-Driven Development training and what I learnt there. The whole event lasted three days and in my opinion it was very effectively spent time. The only thing I didn’t like was a little too long theoretical introduction to the TDD and testing, but it is probably the feature of most trainings that the first chapter must be about only a theory. Fortunately, later it started to be much, much more interesting and the workshops began. They consisted of  pair programming, writing tests, refactoring to patterns, mocking with Mockito, everything I expected from this training when I had enrolled. And everything in the amount that helped be to understand philosophy of software development with TDD on the practical side. Only a basic level, however, because to do it smoothly and quickly I have to spend a lot of time on Test-Driving and learning. But I did the first step.

Unfortunately at the beginning of this training it appeared that my lovely IDE (NetBeans) isn’t a natural-born IDE for TDD. And what’s the problem? NB isn’t smart enough when we are coding and trying to generate code by intention. For example, let’s compare process of creating testing method and how two IDEs: Eclipse and NetBeans are helping us in the following scenario: Continue reading this post …


Be Sociable, Share!

Some NetBeans shortcuts you might not know

Tags: , , , ,

Every developer has favourite Java framework, library or  favourite browser, the more advanced even have favourite design pattern :) Each one of us also have his beloved IDE. The most popular are NetBeans and Eclipse, both with many admirers and enemies who is always ready to argue that one IDE is great, and the other is passe. From time to time, unaware novice developer asks in one or another discussion group “Which IDE choose : Eclipse or NetBeans?” causing endless debate very similar to that in which some people try to prove the superiority of Christmas over Easter, while the other opts for the opposite proposition.

 Continue reading this post …


Be Sociable, Share!

Eclipse and problem with auto generated equals()

Tags: , , ,

Lately my colleague from job encountered following problem:

JSF table <rich:dataTable> was using HashMap to represent data. This Map contained objects collected from the database. After saving new objects to Db and table refresh it showed objects completely different from what we expected. After few hours of searching for a bug in our code or in JSF code it appeared that problem lied in other place.

Eclipse generates equals method checking if classes of compared objects are the same:

...
іf (getClass() != obϳ.getClass()) {
    return fаlse;
}
...

ant such behavior combined with Hibernate can cause some problems because very often while loading data from Db instead of object of our class Hibernate creates proxy object extending base class we are loading. And then equals method comparing getClass() returns false causing strange HashMap behavior. Solution is very simple: instead of getClass() you should use instanceof.

Additionally, as I read in comment on Proxorkut blog, if we use lazy loading in entity classes we should use getXXX() methods in equals() and hashcode() to get variable values because if we try to get them directly from the fields, Hibernate might not initialize them before we try to use them.


Be Sociable, Share!