Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove 'model' sub-packages #573

Open
mihails-strasuns opened this issue Jul 26, 2018 · 0 comments
Open

Remove 'model' sub-packages #573

mihails-strasuns opened this issue Jul 26, 2018 · 0 comments

Comments

@mihails-strasuns
Copy link

@don-clugston-sociomantic :

Our codebase is littered with directories called model which we have inherited from Tango. This is one of the world's silliest coding conventions, and as far as I can tell it is unique to Tango. It was started by one of the early Tango developers who misunderstood the model-view-controller pattern.
Now we've absorbed tango into ocean we ought to remove one of Tango's most bizarre mistakes.

Why it's wrong:

  • It's completely upside-down. A class hierarchy is like a tree. Derived classes grow from base classes. But because of the model directories, we have derived classes at the base, and the base classes are the leaves!
  • Navigation is difficult. The most important classes are hidden several levels deep.
  • This is turn encourages a bad OOP style. If you are doing real OOP programming you should be using abstract classes for anything except the constructor. But because it's easier to find the derived classes, you're tempted to use them directly. You read the docs for the derived class when you should be reading the docs for the base class. You're tempted to view the classes in 'model' as an implementation detail, the parts of the code which are shared between different concrete classes.
  • It's a muddle. 'model' in fact contains more than just abstract base classes. It also contains intermediate classes, which in some cases add no new interfaces, and only provide implementation of some methods. These classes really are implementation details.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant