Better HN
topnewbestaskshowjobs
Log inSign up

develf

19 karma · joined Apr 28, 2017 (9y ago) · 3 submissions

Submissions

comment 9y ago · link · parent

Yes, you are right. I didn't mean to advocate mixing high level and low level logic, different kinds of concerns together in one component. I just take issue with the Clean Architecture bullseye diagram and its preoccupation with layering, classifying those layers, and strict rules about who can refer to who without creating some additional abstraction to pretend the thing you are talking to isn't the thing you are talking to.

comment 9y ago · link · parent

Automatically generating a UI from a domain may please a programmer but isn't likely to please a user. That's how you get UIs like the one Salesforce has.

That could be the right choice in some situations -- it certainly worked out well for Salesforce and allowing extensibility in their model. However if you want to build an app with consumer usability you'll be putting a lot of unique development effort into your view layer.

comment 9y ago · link · parent

Prudent to remember that Robert Martin is a consultant and it's lucrative to sell enterprises a story where their domain logic is a billion dollar asset and following his very particular design pattern will enable them to seamlessly evolve this asset with new technology.

Here's where the story breaks:

- Most app's domain objects and rules are small. You could describe them on a few sheets of notebook paper. The technology implementation (e.g. database or http logic) is a much larger portion of the codebase.

- In most teams, especially startups, the domain rapidly evolves. The technology stacks (databases, SQL, etc) are quite stable and have already been heavily abstracted for reuse over the years. Using these proven technologies and excellent existing interfaces is how you go fast.

- Technology choice isn't just about code interface. Each comes with its own assumptions of system behavior and theory of operation. Plugging a different implementation into your storage adapter interface is the least piece of work you need to think about unless it's nearly a 1:1 swap like postgres -> mysql.

So following a strict clean architecture approach will probably pour concrete around something changing all the time and create friction and extra work in using excellent available technologies.

Instead I'd rather follow pragmatic design guidelines:

- The concept of each component should be clear

- Sensible responsibilities for each component

- Abstractions should serve the composability of your existing design; introduce adapter layers if you truly have more than one implementation

- Keep it simple; optimize for reading the code end-to-end and easier refactoring

These aren't inconsistent with Clean Architecture but probably more productive than adding religious rules.