Thoughts on the Generic vs. Specific Tradeoff

Recorded at:

Summary
What is better, a generic solution or a specific one? Stefan Tilkov’s answer is “It depends.” He compares XML vs HTML, DSM-UML, Internal-External DSL, SOAP-REST, and others, outlining the advantages and disadvantages of each solution, showing that there is no certain answer to an architect’s quest to solve his problem, but there are some guidelines helping along the way.

Bio

Stefan Tilkov is co-founder and principal consultant at innoQ, a technology consulting company with offices in Germany and Switzerland. He has been involved in the design of large-scale, distributed systems for more than a decade, using a variety of technologies and tools ranging from C++ and CORBA over J2EE/Java EE and Web Services to REST and Ruby on Rails.

QCon is a conference that is organized by the community, for the community.The result is a high quality conference experience where a tremendous amount of attention and investment has gone into having the best content on the most important topics presented by the leaders in our community. QCon is designed with the technical depth and enterprise focus of interest to technical team leads, architects, and project managers.

I found one important for me point missing there though, which is code maintenance. I do agree forcing a generic solution to a peculiar problem often results in extra tedious and unnecessary work. Sometimes when the choice is not so obvious I would also consider the fact a generic solution might save you a couple thousands lines of code. These lines might be easy to write but you will have to maintain them later. And if they are easy to write you might be tempted to have them written by a novice developer which certainly won't help the code readability. So maybe it would be better to have a hundred lines of clumsy configuration after all in such case?

I have always found the generic home build frameworks much harder to read, test and debug than the specific and perhaps boring solution.Even worse is the specific and undocumented configuration DSL that you invent for your generic framework. It might work for you but 'then come the next guy'.I would say go for the safe solution, the solution that you know will work. Boring code is very quick to write, it's the thought of repeated work that is hard to cope with. Then when you have a working solution, look for patterns, refactor and generalize.I would worry more about the novice architect than the novice developer.