March 18, 2019

Extension methods are not OOP

Extension method is a special language feature introduced by Kotlin, Swift and other programming languages, which allows developers to add new methods to otherwise unchangeable classes. While at first it seems like a great idea, in reality it contradicts core OOP concepts and ideas.

William Shatner with Nick Cravat as the gremlin
© The Twilight Zone (Nightmare at 20,000 Feet)
Read
January 12, 2019

How to motivate developers to write tests

Creating a motivation for developers to make unit testing part of the software development process can be challenging. Although tests can be made a requirement, without clear understanding of the practical purpose of testing, developers might write tests only to pass the code review and keep the code coverage metrics high. However, if the project manager does not force the developers to write tests, who will? I believe that it is the project itself.

Plane crash in the ocean.
© USA Today
Read
December 9, 2018

DAO in the world of Elegant Objects

DAO (Data Access Object) is an abstraction that is used for CRUD database operations. In Java, DAO is typically implemented as an interface that declares the methods through which a programmer can interact with a database table. A DTO in the form of a POJO object is used by DAO as a data container, which passes data from a programmer to the database and vice-a-versa.

After analysing the criticism about DAO, I have decided to write out my personal thoughts on this subject. In this article I will create an implementation of DAO through the perspective of SQL-speaking objects.

Dao (chinese philosophy) symbol
Dao (chinese philosophy) symbol © New World Encyclopedia
Read
November 25, 2018

Printers are even worse than getters

The well-known disadvantages of getters have already been analyzed by a number of programmers. Yegor Bugayenko has gone even further and suggested a workaround. The pattern called Printer gives indirect access to the internal parts of an object by serializing it into one of the data formats, such XML or JSON and reading it’s content using an XML or a JSON reader. As a result, as Yegor states, the object stays intact and it’s encapsulation is not violated by getters. Although this approach might seem viable at first sight, I believe that it does not solve the fundamental problem of accessor methods.

Viktor Chernomyrdin - the author of the quote We wanted the best, you know the rest
Viktor Chernomyrdin: "We wanted the best, you know the rest" © aif.ru
Read
November 5, 2018

256 Bloghacks and how to get them for free

Most people who start a blog face the questions that are common for newcomers: How to make it popular? What blogging platform to choose? And, in some cases, how make money from it? However, these questions have no exact answers, just as there are no magic bullets for blogging. The moment you realize that, you change your strategy and start looking for successful bloggers and try to learn from their experience. One of such bloggers is Yegor Bugayenko the author of the “256 Bloghacks”.

256 Bloghacks - cover of the book
"256 Bloghacks" © Yegor Bugayenko
Read
October 28, 2018

In search of an ORM alternative: Creating a SQL-speaking object

The disadvantages of Object-Relational Mapping (ORM) have already been discussed by a number of developers. The main argument against ORM is that it leads to the creation of DTOs, which encapsulate data, rather than behavior. If one decides to accept this claim, what alternative solutions does he have? One of them is a SQL-Speaking object.

Concrete spalling
Data and logic are inseparable. © Sydney Strata Specialists
Read
October 21, 2018

Why do DTOs lead to temporal coupling?

In the comments section of one my recent articles I have been asked the following question: “Why do DTOs lead to temporal coupling?”. Seriously, why? Have we not been using them for years in Java without critically thinking about what could be wrong with them?

Many very similar houses placed close to each other
DTOs in practice. © writingfordesigners.com
Read
October 11, 2018

Information vs Data in OOP

The concepts of information and data have drawn a lot of attention from the public in today’s age of big data and data mining. However, the application of these terms in OOP is yet to happen.

Data - "Low SAT scores". Information - "You won't get into the college of your choice"
© Mikhail Yakushin
Read
<< page 1 of 2 >>