Posts Tagged: oop

The eternal issue about Object.hashCode() in Java

Posted by & filed under , .

Have you heard of hashCode() and equals() in Java and the eternal discussions around this? And you know by now the implications of having a messed up relationship in between hashCode and equals so you make sure every time you implement a class with an equals() you have to make sure hashCode() follows suit right? […]

About composition and delegation in the Groovy language

Posted by & filed under , .

When dealing with OOP languages, composition over inheritance has been the preferred approach for a while now as it offers a greater flexibility in most cases. Before you start, I’m not going to get into that dispute whether one should opt for inheritance or not, enough to say that there are cases where composition is […]

Nicer implementations using Java streams

Posted by & filed under , .

I am not entirely sold on the performance of the Java streams but I will accept they are getting much better compared to the first cut, we now have parallel streams and all sorts, and also it provides a (nicer) functional approach to coding. I’m not going to go into the whole dispute of whether […]

Why You Should Use Default Methods in Java 8 Interfaces

Posted by & filed under , .

With Java 8, Oracle introduced the concept of “default methods” in interfaces (and if you really haven’t heard of this — wtf?? — you can read more here about it: https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html). This argue some is a step towards multiple inheritance and as such should be banished from the oh, so pure! Java language. Others point out […]

Of Validating Inputs in Java and Designing for Extension

Posted by & filed under , .

I read recently an article on DZone titled “Defensive Programming: Why You Shouldn’t Check Input Parameters for Validity” (by the way, you can find the article here: https://dzone.com/articles/defensive-programming-via-validating-decorators) and it made me think — and write this post 🙂 For those of you who don’t have the patience to read the full article, the author […]

Do We Still Need the Singleton Pattern?

Posted by & filed under , , .

If you have been working in software engineering for a while chances are you have often come across (even if you didn’t know it!) design patterns. If you haven’t, as I said, chances are you just don’t realise you have used them — so I strongly suggest the “Gang of Four” book as a starting […]

What Most Schools Don’t Teach…

Posted by & filed under , , .

If you work in IT, you have probably by now have seen the famous video on YouTube labelled “What most schools don’t teach” — where Mark Zuckerberg, Bill Gates and a few other prominent figures are talking about how easy it is to program, and how only 10% of the USA schools teach programming. It […]

network pc monitors

Developing for multi-cores and the cloud

Posted by & filed under , .

I have noticed recently that “cloud” and “multi-core” became buzz words in the Java world. (About time if you ask me!) The interesting bit is the implication it has on writing code — and so many developers (and not only!) are blogging their nuts off about this. All of a sudden it is ok to […]