Empower the Team

…or why sometimes 1 + 1 > 2

lambdaj proves Java programs can be concise and even more elegant – in a functional kind of way

leave a comment »

Is the Java programming language too verbose? lambdaj clearly proves the answer is NO.

Java programs usually are, because Java APIs (starting with the SDK) have built a poor reputation for the language.

This powerful library might help us change that in the future.

In a nutshell,  lambdaj allows you to manipulate collections in a pseudo-functional and statically typed way.

This means you can reduce your stereotypical and superfluous ways of looping in Java to equivalent one-liners that are:

  • much easier to understand (thus allowing you to focus on the actual problem not on details)
  • type safe, being written in Java benefits from static typing (and all the good things that derive from here – clear semantics, compiler checks, tool support in refactoring)
  • concise, less error prone, giving you more power per line of code

Below I pasted some usage examples from their site.
I did not add any explanations, because I’m sure you’ll understand what’s going on straight away:

List<Person> personsInFamily = asList(new Person("Domenico"),
                              new Person("Mario"), new Person("Irma"));
forEach(personsInFamily).setLastName("Fusco");
List<Person> sortedByAgePersons = sort(personsInFamily, on(Person.class).getAge());

List<Integer> biggerThan3 = filter(greaterThan(3), asList(1, 2, 3, 4, 5));

List<Integer> ages = extract(personsInFamily, on(Person.class).getAge());

Map<String, Person> personsByName = index(personsInFamily,
            on(Person.class).getFirstName());

Person me = new Person("Mario", "Fusco", 35);
Person luca = new Person("Luca", "Marrocco", 29);
Person biagio = new Person("Biagio", "Beatrice", 39);
Person celestino = new Person("Celestino", "Bellone", 29);
List<Person> meAndMyFriends = asList(me, luca, biagio, celestino);
Group<Person> group = group(meAndMyFriends, by(on(Person.class).getAge()));
List<Person> oldFriends = filter(having(on(Person.class).getAge(), greaterThan(30)),
            meAndMyFriends);

I really look forward to use this powerful tool!

Written by dyancorutiu

May 21, 2009 at 12:46 am

Posted in refactoring, software development

Tagged with

Forget OO… use a Rule Engine !

leave a comment »

This is the most funny-scary reason to build/use a rule engine for your apps:

“Drools / JBoss Rules is a very good solution to stop your business logic from being fragmented and scattered throughout your code” from Paul Browne (http://www.theserverside.com/news/thread.tss?thread_id=43901#225703)…

or in other words and images:

Why use a bus (a highly cohesive business object encapsulating several rules and behaviours), when you can use several cars (rule objects) to achieve the same thing ?

Rules vs OO

Rules vs OO

Which option is greener ? (image from http://makeitgreen.webs.com/cbb.html)

Written by Maria Bortes

April 2, 2009 at 10:42 pm

Software Development Evolution

leave a comment »

It is becoming more and more clear to me that the next significant step in software development evolution will not be a new technology or a new tool,

but an approach that successfully incorporates our hardwired human nature in the way we develop.

In InfoQ Interview: Linda Rising on Collaboration, Bonobos and The Brain Linda Rising points out that scientists initially believed the conscious mind

is like the tip of an iceberg, while the subconscious is the remaining 90%.  However, later studies suggest that our subconscious is the whole iceberg,

while our conscious is actually just… a snowball on top of it.

iceberg2

If only we could learn how to drive this iceberg…

Written by Maria Bortes

February 1, 2009 at 7:06 pm

Being Agile as a personal skill

leave a comment »

I have stumbled yesterday on this presentation given by Linda Rising at QCon SF 2007: “Perfection Is An Unrealistic Goal”.

It underlines the impedance between how humans are hardwired to work (in ~90 min focused sprints followed by a 20-30 min break)

and the prejudices haunting our workplaces (where productivity is associated with longer hours without any break and agility means

people can interrupt each other at any time).

Written by Maria Bortes

February 1, 2009 at 3:33 pm

Posted in agile, change, courage

Tagged with ,

Mark Twain brings you the news

leave a comment »

Today’s news on guardian.co.uk:

Bank shares finished dramatically lower, with RBS – almost 70% owned by the taxpayer after yesterday’s announcement – down by 65%

and Lloyds HBOS suffering a 33% loss. Barclays, which lost a quarter of its value on Friday, fell a further 10%.

One century-old lessons still unlearned:

A banker is a fellow who lends you his umbrella when the sun is shining, but wants it back the minute it begins to rain. (Mark Twain)

Written by dyancorutiu

January 19, 2009 at 11:38 pm

Posted in Thoughts, news

Tagged with , ,

Can we make it to the other side ?

leave a comment »

The Broken Bridge of the Dream - Salvador Dali

The Broken Bridge and The Dream – Salvador Dali

Written by Maria Bortes

January 19, 2009 at 11:08 pm

Posted in Thoughts, change, courage

Tagged with , ,

How’s work?

leave a comment »

crossing the dip

crossing the dip (Grigorescu)

Written by dyancorutiu

January 19, 2009 at 10:08 pm

Posted in Thoughts

Tagged with , , ,

Take that, religious fanatics…

leave a comment »

Precise measurements reloaded: God is to yardstick as Faith is to …
precise measurements
religion?

Written by dyancorutiu

January 19, 2009 at 9:28 pm

Posted in Thoughts

Tagged with

Quote of the day

leave a comment »

“Only those who dare to fail greatly can ever achieve greatly.” – Robert Kennedy

Written by Maria Bortes

January 18, 2009 at 7:25 pm

Posted in Thoughts, courage

Tagged with , ,

Quote of the day

leave a comment »

“Men go abroad to wonder at the heights of mountains, at the huge waves of the sea, at the long courses of the rivers, at the vast compass of the ocean, at the circular motions of the stars…

and they pass by themselves without wondering.” – Saint Augustine

Written by Maria Bortes

January 12, 2009 at 11:29 pm

Posted in Thoughts

Tagged with