Presentation layer vs business layer vs data layer
Hello, can someone explain why we have things like
presentation logic
, business logic
and data logic
pls.
I know that we need them because of principles like separation of concerns, but why do they matter, just for easier mantainability?
Can someone confirm if the following is correct pls:
presentation layer
- UI, how everything should be displayed. It can still contain some logic, like if user is login, display a particular icon at top left of screen etc.
business layer
- workflow of how things should work based on a particular domain. Like if user is less than 18 years old, that person can't register.
data layer
- We make use of functions/api to retrieve data from database
By the way, this is what we call as system design?3 Replies
I know that this kind of principle is widely used, I don't know if this only applies for C# or it's just a paradigm/way of doing and applies universally across any programming language?
id say maintainability is a main focus for every software architecture
the presentation/infra/etc seperation is common in a alot of archs, its not a c# thing
but the most common one is Clean Architecture, which is common in c# ad well
there are also archs that dont do this type of tradition layering
not strictly at least
like Vertical Slice Architecture, which a lot of people in this server like
yep I see