U
U
Urukhayy2016-11-19 14:25:35
Programming
Urukhayy, 2016-11-19 14:25:35

How to choose the direction of OOP application architecture?

If you need to implement some kind of application, then which of the many ways of architecture to choose?
Even some event in this application (event) can be implemented both as a separate singleton class, and as just a field in another class, and as an enum, and as a polymorphic class for many events.
Are there practices that should be followed to make the architecture correct and simple?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Sergey, 2016-11-19
@Urukhayy

and as a separate singleton class

What for? Why singleton? Answer the question when is it needed?
- Separation of responsibility is an important principle of engineering in principle.
- SOLID principles - they give a good idea of ​​how to work with dependencies and do system decomposition. Strongly intersects with encapsulation, polymorphism and separation of concerns.
- Patterns GRASP - a mixture of principles and patterns, describe the nuances of the life cycle of objects and their interaction with each other.
- Law of Demeter - about encapsulation.
- CQRS - approach to separate write operations and read operations. Naturally, this approach does not work if you need to implement atomic writing and reading, but this is a minimal set of tasks.
- Refactoring. He is always needed. It needs to be done a little bit when you can see that "it's already getting in the way" or "it could have been done better." Well, that is, this is not a rewriting of everything and everything in large pieces, but small changes that over time evolutionarily change the architecture of the project. It is possible only if the code is covered with tests, this is a separate bold topic.
No need to know the "architecture", they are only the result of following the principles. And even more so, "patterns" are just elements of architecture. No need to dwell on them, it's just a dictionary.
https://en.wikipedia.org/wiki/Category:Programming...

B
bnytiki, 2016-11-19
@bnytiki

Excuse me, you just wrote something like -
How people are treated, how they choose which medicines to give, which tests to prescribe.
This is what people study at medical universities for years, then internship, residency ...
There are probably practices.
But I don't know them.
After 20 years of experience, it all happens like this:
Well, you just imagine what is happening inside the program and understand how it should be divided into parts and into which parts and what the choice of one or another option will lead to.
You just think logically and decide.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question