Tag Archives: netbeans

Acidental scala upgrade with sbaz

And then I was playing around with the scala tools that come in the installation’s bin folder. There is something there called sbaz, and this name sounds so different that I just HAD to play with it to find out what it does.

Lets first explain what I discovered later: what sbaz does. It is some kind of scala package manager for your local scala installation. If you issue a sbaz available, it will list all packages it is able to install for you, for example. Also, and this was the somewhat tricky part for me, it is able to upgrade all current packages to their latest versions, including the main scala stuff, like the scala-library.

This is all great.. as long as you don’t run sbaz upgrade by mistake. This happened some weeks ago to me… And I was lucky enough to not have any major problem. I was running scala 2.8.0 at the time, and 2.9.0 was already out. Result: I upgraded to scala 2.9.0 before I intended to… and one day before a speech I gave at a conference, where I presented plenty of scala code examples.

In the end all went well, but I had to update some sample code, and to upgrade the Netbeans scala plugin to the version that supports 2.9.0. The other option would be to erase the installation folder and install scala from scratch again, but I chose to use this “event” to upgrade to 2.9.0 for real =)

Bottom line: learn that scala has a very nice package manager tool called sbaz, but use it with care ;)


sbt and maven

A few months ago I talked about my first impressions about sbt (simple build tool) here. My conclusion at the time was that NetBeans + Maven combination would suit me better. This changed a little bit, so I’m revisiting this topic to explain why.

First, I explored sbt a little more. I certainly still have a lot to learn, but I found out one thing that is making a lot of difference: you can use a maven pom file to handle your dependencies. This is great for a few reasons:

  • you can leverage your existing knowledge of pom files;
  • I’m not comfortable (yet) with the sbt own way of handing dependencies;
  • you can use tools that doesn’t support sbt directly – actually I don’t know of any that does that.

Lets elaborate some more. First, lets say you have a project that already uses maven. The first point means you can just type ‘sbt’, create an sbt project, and the tool will be able use the pom.xml file as a source for the project dependencies configuration. You will just have to use the sbt command ‘update’ after each time you change the pom file – which is very reasonable.

Second, the way sbt handles dependencies. Code. Basically, you configure the dependencies in a scala file, that gets compiled with the rest of the project. I don’t find this bad nor good. For now, I don’t have a strong opinion about this – but its still not comfortable.

Finally, the third point means you can use, say, NetBeans, with its great maven support, while using sbt as well. For a small personal project I’m currently working on, this is being very useful. My current development setup consists of NetBeans as the IDE, with sbt running in a console window in the ‘~test’ state. Every time I hit save on a source file inside NetBeans, sbt gets it, compiles and runs the tests. Yet, because I’m using an IDE instead of simple a code editor, a have full source code completion – which is really nice.

Of course this doesn’t work perfectly all the time – NetBeans gets confused from time to time and you might have to ignore some editor warnings. Nothing too bad though.


TDC – The Developers Conference 2009 – day 1

So, one more Java event happened this last weekend down here in Brazil. The Developers Conference, organized by Globalcode, took place on the 6th and 7th of November in São Paulo, and it is going also to Florianópolis (9th) and Rio de Janeiro (11th).

Like last year, the event featured international speakers, and was really nice. In this and two other posts, I’ll be talking about what happened in São Paulo, since this is the location I attended.

Lets start off saying that this edition was the best one until now. Among the international speakers, we had Rod Johnson (Springsource), Ed Burns (Sun) and Mike Keith (Oracle).

Opening

The event started with Vinicius Senger’s (Globalcode) dancing robots. They started some music and turned the robots on, which started to dance. The dance was programmed by themselves into the toys. Really funny =)

dancing robots

dancing robots

Fast forward to a break that happened later, here is a closer picture of the robots in the stage above:

robots!

robots!

For the music, they used a parody they made themselves. They created a new music, based on an existing one, with lyrics related to software development. As soon as I have the link, I’ll post it here. That was really really funny.=D

One thing that always grab my attention at those events are how much some people are excited about their stuff. You could see this clearly about Vinicius in the entire event; but special was his scream at the end of the opening: “I love what I do!”

Rod Johnson

Rod Johnson was the first international speaker. He talked about how things are evolving in the software development world, and mentioned things like the fact that different kinds of data storage might be interesting, instead of using relational databases for everything; cloud computing and how Springsource (and VMware) might be involved (CloudFoundry). It also seemed that he likes Groovy and Grails a lot.

rod johnson at tdc day 1

rod johnson at tdc day 1

The talk was a little bit philosophic but interesting nonetheless.

Career Panel

Next we had a career panel, featuring the three international speakers. They basically told us some stories about how they started their careers, and things like what would they expect in interviews and the like.

career panel

career panel

Lightning Talks

Spread during the day, we also had lightning talks, with subjects like GWT, Google Guice, Agile Developement and Software Architecture, EJB 3.1 (samples, available on Kenai) and ScrumToys (which is available as a NetBeans sample project and a Glassfish sample application). Two pictures of those:

agile and architecture

agile and architecture

ejb 3.1 samples

ejb 3.1 samples

And in-between presentations, Vinicius appeared again with one more toy. Now, a robotic balloon:

robotic baloon

robotic balloon

Mike Keith

Following we had Mike Keith talking about J2EE 6. He talked a little bit about the timeline of the past releases, and about a few new features coming. Note-worthy, although not that new, is the definition of JEE Profiles – different versions of the application server, with different sets of libraries, for different scenarios.

For some odd reason, I don’t have a picture of this… so lets move on.

Ed Burns

Finally, Ed Burns talked about JSF 2.0 components. Some quick highlights: development of components should now be really easy; components can be built in groovy and can be packaged together with CSS and JS files; support for EL inside CSS files and CSS can be put anywhere in the page – JSF takes care of moving them to the page head tag later.

JSF 2.0 Components with Ed Burns

JSF 2.0 Components with Ed Burns

And that was all for day 1 of the event! The next post will be about the second day, which was as busy as the first one. Stay tuned!

EDIT: Click here for the coverage of the second day of the event.

EDIT 2: Here is the link for the video.


Mercurial basics for CVS users

We just made available here the initial code (only a draft right now) for the peer-to-peer project mentioned in this previous post. One of the things we decided to do differently from previous projects is to use an alternative approach for version control. So, we are switching from CVS to Mercurial. My goal in this post is to show what changes in the daily work using it.

The first thing to understand is that Mercurial is a decentralized version control system. So, each developer will have its own local repository. When you commit, you’re not committing to the server, but instead to your local repository. This is cool because this way you can commit very often, and without breaking anyone else’s code. Also, you can easily work offline (airplane, anyone?), and synchronize when you get internet access.

So, when you want to get the most recent version of the project, you pull it from the main repository. And then of course solve eventual conflicts. This allows you to be sure that your code is fine with the server’s, i.e. all the tests passes and so on. After that, you are ready to push your code to the main repository.

So, don’t forget that now, after commiting you code, it is NOT sent to the main repository just yet. It will only get there after you issue a Push from your local repository to the main one.

The exact way to do this will be different depending on the IDE you are using, but the concept is the same. Please consult the official site mentioned earlier and the documentation of your IDE for more detailed information. For NetBeans 6.1, for example, you can find something here.


Follow

Get every new post delivered to your Inbox.