python-patterns icon indicating copy to clipboard operation
python-patterns copied to clipboard

3-tier.py and mvc.py are almost identical

Open fkromer opened this issue 9 years ago • 3 comments

3-tier.py and mvc.py are almost identical from a high level point of view. The only difference is that in 3-tier.py the logic instance and the ui instance may be assigned to the data instance explicitly. In mvc.py the model instance and the view instance is assiged to the controller instance statically during its creation.

fkromer avatar Feb 20 '16 12:02 fkromer

Quality attribute explicit assingment (3-tier.py) implicit assignment (mvc.py)
code reusability + -
usage complexity - +

fkromer avatar Feb 20 '16 12:02 fkromer

What would you propose, to remove one of them? Initially there was only mvc.py but later on a contributor decided to also add 3-tier.py, and I thought that it might be useful for some people.

faif avatar Feb 21 '16 10:02 faif

I like the explicit assignment concept in 3-tier.py. But most people will know and find the pattern under the name MVC. I would merge the explicit assigment of 3-tier.py into mvc.py and delete this version of 3-tier.py. I think i have read about a 5-tier pattern already. Maybe a n-tier pattern is missing and needs to be implemented as python example.

Edit I found the example for a 5-tier pattern implementation but it is in object oriented C and in the domain of embedded software (look for "Model example" on this website). But i am pretty shure that i have read example code implemented in Java or some other true OOP language too. If i find the ressource i let you know... Some other explorative web ressources: n-tier/3-tier Pattern Difference between n-tier and 3-tier

fkromer avatar Feb 21 '16 13:02 fkromer