Live data from Hacker News

A Theory of Software Architecture

danuker.go.ro

241–246 of 246 posts

Re: A Theory of Software Architecture

#241

The author makes an observation that has been growing on me in the last few years; many ORM models really prevent you from using an architecture like this, because your “pure core” actually has to have logic for DB operations like saving/filtering. It’s possible to build a DDD Repository in Django or Rails, but really a lot of work. I think the frameworks like sqlalchemy and NHibernate seem to do things a bit better…

Absolutely.

[Uncle Bob is clear](https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-a...) that the inside circles must not know about the outside world.

That is, your business logic is not allowed to know what a DB operation is, nor should it do any DB operations behind the scenes.

> Frameworks and Drivers.

> The outermost layer is generally composed of frameworks and tools such as the Database, the Web Framework, etc. Generally you don’t write much code in this layer other than glue code that communicates to the next circle inwards.

> This layer is where all the details go. The Web is a detail. The database is a detail. We keep these things on the outside where they can do little harm.

Re: A Theory of Software Architecture

#242
post #218

Earlier quoted context omitted.

We just did a major reorg, and everyone who promoted that locked in tool got let go. There were other reasons for the reorg, but take this as a warning, if the tool you promote isn't productive you lose your job.

Without additional context, that seems a bit extreme. People often promote tools because they have some experience and have not (yet) had a poor experience with them.

These were senior technical architects that I doupt wrote more than a dozen lines of code in the tool, nothing real. They had great pie in the sky ideas, and the tools did useful things, but they forced everyone to use it for many years and kept defending it for years while evidence kept building up that using the tools made projects take 5 times longer than just writing in C.

If they had accepted the evidence and backed off the tool until it could deliver the better than C quality (which it did do) at the same speed of development they might still be around. However in the end we need to ship code to make money and our competitors were catching up on us which isn't acceptable to the business.

Let this be a lesson when you want to adopt new tools. They might be better but they might have some unexpected downside that means they are not useful.

Re: A Theory of Software Architecture

#243

The author makes an observation that has been growing on me in the last few years; many ORM models really prevent you from using an architecture like this, because your “pure core” actually has to have logic for DB operations like saving/filtering. It’s possible to build a DDD Repository in Django or Rails, but really a lot of work. I think the frameworks like sqlalchemy and NHibernate seem to do things a bit better…

Absolutely. [Uncle Bob is clear]( https://blog.cleancoder.com/uncle-bob/2012/08/13/the-clean-a... ) that the inside circles must not know about the outside world. That is, your business logic is not allowed to know what a DB operation is, nor should it do any DB operations behind the scenes. > Frameworks and Drivers. > The outermost layer is generally composed of frameworks and tools such as the Database, the Web Fra…

The tension I observe is: when should you use a highly productive and well-known framework like Django or Rails, and when should you build your own DDD/Clean architecture?

This discussion has gone on for a long time, e.g. see the back-and-forth around https://dhh.dk/2014/test-induced-design-damage.html after Weirich demonstrated what sort of thing is required to use the Hexagonal Architecture with Rails.

I believe that if your system is sufficiently complex, you'll start to see the benefits of a more structured architecture, but it's a net drag on productivity for small projects. These days perhaps you chop your monolith into microservices before reaching the ROI point for Clean/Hexagonal?

I could believe that a "framework-first" architecture is more productive while you have <100kloc. Or maybe it's <10kloc, I don't know. I'm certainly seeing the architectural strain with a Django-first architecture in the current 150kloc monolith I'm working on, and chopping into a few services makes sense there for other reasons, so it might obviate the need for a bigger refactor onto Clean/Hexagonal.

Re: A Theory of Software Architecture

#244
I think software architecture is the wrong word for this. It’s module structure, architecture to me includes all the surrounding bits concerning the “ilities”. (Availability, Interoperability, Modifiability, Usability, Testability, Security, Performance). I say this because getting the module structure right is important but not the only factor to a successful application.

My favorites in regard to the topic of module structure are David Parnas and Juval Lowy

Re: A Theory of Software Architecture

#245

Another "academic level" demonstration that doesn't work in practice. It's so simple to say "look how awesome this approach is" on a 50 line program, "just use pure functions everywhere". In real life things get very complex because there are 200 working parts interconnected. And not because "it's bad design". But because that is the requirement. Soon you get pure functions with tons of parameters or parameters that…

> In real life things get very complex because there are 200 working parts interconnected. And not because "it's bad design". But because that is the requirement.

These sorts of things are always better discussed in terms of specific cases instead of generalities, but I think one of the key parts of good software engineering is factoring the requirements into the simplest design possible.

And even when time or other considerations prohibit creating an extensive design ahead of time, practicing a few well-chosen heuristics like "use composition", "keep functions and methods short", "use clearly defined and consistent terminology in your abstractions" can go a long way to making code less unruly and easier and cheaper to refactor down the road.

Re: A Theory of Software Architecture

#246
post #234

Earlier quoted context omitted.

Very insightful. Can I read more John Carmack's letters somewhere?

Took me a while to find something useful, but here you are: https://fabiensanglard.net/fd_proxy/doom3/pdfs/

Wow that's a lot of interviews and letters. Cheers
Post reply on HN