I was writing the text below as a comment, but it ended up getting a bit long.
One thing I do not like about the term 3 camadas
, is that I never know if you're referring to 3-layer
or 3-tier
, our language ends up creating a confusion between these two architectures.
In any case, I hope you do not confuse MVC
with 3-layer
, although it is possible to make a relation between Model -> Presentation
, Controller -> Business
and Model -> Data Access
.
The default MVC
is a Design Pattern
used to make a logical separation of the user interface, whereas 3-layer
is an Architecture.
For example, we can have an application made in MVC
with only 2 layers, where we build our Apresentação
and Regras de Negocio
within MVC
, in this scenario Apresentação
and Regras de Negocio
end up behaving like a single layer, but the Data Access layer is still isolated ( Banco de Dados
).
On the other hand, we can remove the Regras de Negocio
from Controller
and implement them elsewhere, for example in WebService
, in this case we have three layers.
If you prefer you can move your Apresentação
to the client, for example using SPA
for example, and keep your Regras de Negocio
to API RESTful
And finally we can create more layers, for example other layers of Apresentação
... Desktop
, Aplicação Mobile
, Web
, etc ... split Regras de Negocios
, for example Financeiro
, Contabil
, Operacional
, etc ... and even the layer of Acesso a Dados
... NoSQL
(eg: MongoDB
) and SQL (eg: SqlServer
).
In any case, MVC is not always the best for the project. in some projects 2-layers
is more than enough, in others it may be necessary to use n-layers
, the same goes for tiers (2, 3 ou n)
, after all the system is scalable is not always the most important.