Jorgen Grahn <
grahn...@snipabacken.se> wrote in
news:slrnn8dqb1.5...@frailea.sa.invalid:
I think the key words here are "If I identify...". Indeed, if creating a
separate type has benefits, then of course that's way to go. And OTOH, if
it wouldn't bring any benefits then it would be over-engineering. I have
seen plenty of the latter as well.
Of course, the border between good design and over-engineering is not so
clear in real life and depends on all kind of things, including the
actual usage of the software piece. A well-designed piece of software may
appear over-engineered when used in another context. One of the worst
examples of this I have seen is a library which wraps a SQL database in
an heavy OOP design so that each table and table row basically becomes an
OOP object. All good and fine, but in our product the business logic was
not formulated in this object-oriented interface, but in the next layer
of software sitting on top of that library. The next layer does not have
such expressiveness and basically operates in terms of simple tables
(similar to SQL). To make this work, the absolute minimal set of needed
operations was identified and wrapped up so they could be used by the
next layer. Each wrapped operation involves figuring out the needed OOP
types, instantiating them correctly, translating the content of tables to
calls to objects - and I am pretty sure somewhere deep inside the library
all this information finally gets translated into some simple SQL
statements again. So basically the main effort when using this library
(inside this product) goes to translating the table-based interface into
OOP interface with lots of types and classes nobody cares about, just so
the library can translate it back into table-based SQL again. The
compiled size of this library is 455 MB, by the way.
Cheers
Paavo