E
E
expressrus2017-04-12 17:20:53
Software design
expressrus, 2017-04-12 17:20:53

How to properly combine mvc and 3-layer architecture?

There is a small php 7.0 project, on self-written mvc without frameworks. The teacher requires for the delivery of the laboratory to implement in it and explain the 3-layer architecture:


LEVEL OF ACCESS TO DATA (DATA LAYER)
LEVEL OF SERVICES (SERVICE LAYER)
LEVEL OF BUSINESS LOGIC (BUSINESS LOGIC, DOMAIN LOGIC)

I assumed that all models of my application can be attributed to the data access layer. And all controllers to the level of business logic. But what about the service level? Yes, and where to take the views then) In general, I'm stupidly confused (I even argue incorrectly. I would be glad for your tips)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Maxim Fedorov, 2017-04-13
@qonand

The teacher requires to pass the laboratory to implement in it and explain the 3-layer architecture

Did the teacher explain how to do it? Maybe just read the notes?
models should not be in the data access layer. It's actually two different layers.
the controller has nothing to do with business logic. The controller (according to MVC) is only responsible for processing user requests and that's it. It should not contain any business logic or data access.
It will not be possible to explain to you how to build such an architecture within the framework of the answer to the question, since the topic is quite extensive, so I recommend studying a couple of articles:
article 1
article 2
article 3

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question