DEV Community

Discussion on: What Is Business Logic?

okolbay profile image

All code that says something about your business - is your business logic. Everything else is an infrastructural detal. Say your domain is making donuts. All classes, methods and variables that say “dough” “milk” “filling” “oven” “bake” are your business logic. Everything that says “rest controller” “rabbit mq consumer” “event listener” is infrastrucutal detail.

On a side note, separating two is quite a challenge. Infra depends on business logic but never vice versa. There is no place for frameworks in BL layer, and only few helper libraries like uuid and assertions could be used.

I would recommend Robert Martin’s talks on clean architecture to get an idea of possible implementation of such separation