Archive for the ‘Uncategorized’ Category.

My presentation about JBoss Clustering at RIOJUG 02/25/2010

Last Thursday I did a presentation about JBoss Clustering at RioJug, and it was a very nice, energized and pleasant night. The room was full and people there were eager to participate and asked me a lot of interesting questions about the topic and beyond.

I’d like to thank again RioJug’s leaders for the time spent and all attendance that did not care about the heavy rain that felt just before the session.

If you weren’t there, you can see the presentation at SlideShare : http://www.slideshare.net/marciomarinho/jboss-clustering

Sorry, but as I presented it here in Brazil, it is written in my mother tongue portuguese.

Happy new year !

I wish all of you my friends a very happy new year. May all your plans become true !!!!!

In 2010 I will be very activelly posting nice things to share and discuss with all of you ;)

Sincerely,

Marcio Alves Marinho

Making your code more testable

Testability is one of the most beautiful, desireable and must have feature that a code must be compliant. Nowadays there is no space for untested and low quality code, that means many problems at production environments, long hours debugging code, and late delivery.

As usual, this is again a farly big subject that I will try to resume in few tips to improve code’s testability as follow :

First of all, start designing and writing a test for your code before you write your business code, just follow test driven development approach.

Never write long methods, because it will probably lead to low quality code and cluttered design, as a result it will make your test very difficult. If there is a need for such a big calculation, temporary variables or things like this, then just split the big method into smaller methods and delegate your calls.

Add the right responsibility to the right object, another smell that will make your tests hard is when one object knows too much about the other object’s internals.

Try to write cleaner and less code, because less you write, less errors you’ll produce/find, and faster will be your program.

Singletons are usually evil for tests, because they usually cache some data that may hurt you.

The curse of custom code

Somebody might ask me : Marcio, aren’t you a developer as well ?? and I would answer : Yes, of course.

Then this same person can ask me again : Don’t you like to create new code by yourself ? and I would answer : Yes, and tell him a good story…. :)

This real story that happens in many companies is really sad, and probably will keep happening.

I’ve seen many people and companies that simply love develop something new by themselves, well, that’s not a bad idea at first look, but we should always look at other options. Sometimes we try to re-code something that already exists as a tool, application server, monitoring device and so on.

The point is that sometimes it’s way less expensive if we buy something ready to be used, such as a component or integration tool, rather than try to develop it internally in the company. The main problem is related to the TCO, because after ( or while ) developing something new we need to extensively test it to achieve maturity, and there are things that are not so simply to test, like distribution and concurrency.

This is a rule I use, whenever I am architecting/designing something new I always look for reuse something, and this can be something already done by the team or an external componente offered by a vendor.

The calculation is simple, try to measure or to estimate how many hours each developer should spend to develop the new solution, then add more time to test, more time to bug fixes, and then search for a similar product and compare the prices.

The simple is good

Sometimes we make things to fail due to our ability to complicate what we do. I’ve seen this happening many times. But I have a simple rule for this : If something is becoming too complicated to accomplish, then stop and try to think on a different way, because probably we’re trying to do something unecessary in the middle of the process. The best solution is always the simplest one.

Certified Scrum Master Training ( May 30-31 / 2008 )

Definitely that was the best course I ever attended !

See the photos here.

I guess I lost my fear about to flight ;)

As you may know I am a Senior Software Engineer that is passionated about software and technology, and I’ve been studying agile practices for while, XP, Lean, an SCRUM in special.

Last weekend I attended to a Scrum Master Training in São Paulo ( I am the first guy of the right side ) :

Scrum Master Training --> at lunch time ;)

Indeed that was one of the greatest experiences I ever had in my life. There I could learn more about what exactly is scrum and how to do scrum. It’s funny how we can mis concept things, or do the right thing on the wrong way.

The course was great, and I don’t have words to thank Boris, Peter and Danilo about the teachings and experiences shared with us. I am deep happy because I could improve myself a lot there, learning how setup a scrum team, plan, prioritize, estimate, rules, deliver as fast as possible ( with quality ! ), measure the teams productivity, run retrospectives, auto organization and so on. Besides that I had a great time with my classmates, that are clever and skills full people, and they help me a lot also with their questions and experiences.

It’s really a mindset shift ! We were driven to think on a different way that we are used to think.
There we saw how scrum run things better than the traditional project management way, and we realize why scrum is much more superior than the old fashioned traditional software development, that is chaotic by nature.

Another point is that I have no words to describe how good trainer Boris is, because he could answer all my questions about how scrum can solve the issues related to software development, such as fixed price/time contracts, big projects, measurement, estimative, planning and more. Peter has also contributed a lot with his experience as a scrum coach, and Danilo’s presentation about how they implemented scrum at globo.com was priceless !

Many thanks to all of you people, and I hope we can meet again soon !!!!

About Paulistas

I don’t really know who started it, that cariocas and paulistas are nasty ( well, at least I ever heard that each side hates the other party ), because they are the way they are. Btw, I am a carioca and I always heard from people here that paulistas don’t like cariocas, that paulistas are unpolite, that paulistas are… blah blah blah.

My opinion about this is : This is not true !

I was there in Sao Paulo for the first time last weekend ( May 30-31 / 2008 ), because I attended to a Scrum Master trainning ( that I will be posting about soon ), and everybody was very nice and kind to me. The people from the airport, the taxi drivers, the hotel staff ( these people are really great ! ), the restaurant people that I had dinner, my classmates ( awsome people ! ) , and so on.

Of course I had an incindent in the airport, and the story was that I forgot my perfume at home and I had to by a new one, everything was fine and I was going to pay, then suddenly a lady pushed me when I was about to pay. What can I say ? all paulistas are evil because an unpolite woman pushed me ? of course not ! I cannot blame 8.000.000 people just because of 1 !!!! Better question : how many people in rio have pushed me in queues ? hhhhmmmm one zilion maybe …. heheheeheh

I am not saying that there are no bad people anymore neither in Sao Paulo nor in Rio, of course there are, but the underlying point is that we can’t make pre-assumptions without knowing the reality.

I simply loved all people there and that part of the city is aewsome, and I want to go there again as soon as possible.

The funniest thing was that even speaking in portuguese everybody asked me the same question : Where are u from?, well, I discovered that I don’t have a strong carioca’s accent, and Rosangela confirmed that saying that I am almost a paulista [:-)]

Rich Clients

These days I’m looking at web development in a deeper way. Well, too many things to go through in order to update myself [:)]. I’ve been working on a rich-client swing GUI, that has been an amazing experience.

Rich clients as also known as smart clients or fat clients are a very nice and powerful user interface whenever we need more than the web browser/html can do for us. Web applications are really desirable because we can serve lots of clients using the same application server, and more, we don’t have to worry about deployment, because whatever the user needs it’s a web browser. On the other hand web applications don’t have the power of a swing GUI or a C# .NET GUI has, because if we want to pre-process something that the user is doing we’ll end up having a bunch of round trips to the server side.

Rich clients give us the ability to pre-handle and pre-process any user interaction/calculation/validation before it goes to the server side, actually some piece of business logic is also distributed between the client and the server side, in order to facilitate the applications job. Of course, it shouldn’t be applied to any domain, instead we should look at the up and down sides of our choices, but if your problem seems to be something like this I wrote up, then you should consider using a rich client.

Testing the software

Testing has been a hot talk these days, indeed, testing is something needed to assure that the application is behaving as it should be.

I watched 2 nice talks about testing, the first one was Coplien and Martin Debate TDD, CDD and Professionalism, and the second one : Designing for Testability

It’s very nice to see different points of view about the same subject, but there is an agreement in the community ( that I share ), that is we must test !

There are lots of different test, such as unit tests, integration tests, functional tests and so on. The Test Driven Development philosophy is based on test first and then write your business code. This is a preventive technique, because a failure must be found first, and then you’ll fix it on a evolutionary way implementing your code, adding a new test, and so on. Looking at this we see Unit testing that is a way of validating every piece of function ( method in OO world) that we have in our software.

In despite of different points of view, testing is an evolution that software development has been passing in the last years. Ship a software without testing made sense in the past, but nowadays unit testing and TDD are the most natural path of every software developed on a professional way.

I will posting more about testing very soon !!!