Answer the question
In order to leave comments, you need to log in
How to create architecture correctly?
I have no experience and education in IT. But I'm learning a bit of programming for myself. Surely somewhere in universities they teach how to build software logic. How to learn to do it? What is it called anyway? Software architecture? Seen often create UML diagrams.
For example, I want to create a simple snake game. How can I correctly determine which classes I need, which method will be where and build the whole connection? Maybe there is some literature to understand at least the basics. Well, for example, I know there is a single responsibility principle. What to study on this topic? Patterns?
Here, for example, here https://habr.com/ru/post/231087 there is a picture with layers of architecture. How to do it?
Answer the question
In order to leave comments, you need to log in
In general, you need to take a piece of paper and set at the highest level of abstraction all possible in the current representation of the entity. If the conversation is about the "snake" - ask the question, what do you have in the game as entities. Let's say there is a snake, there are walls, there is a zhrachka, you write them as entities. They decided to add a "fly" - write too. Then write who knows how to do what: the snake can crawl, knock on walls or a meal, grow and possibly something else, the walls just stand, the meal can appear, be eaten. And so on, until you describe the whole game in primitives. Further - each entity is a class, each relation is a method, each parameter, found out in the process, is a property of the class. But the farther into the forest, the bigger the rake. At the levels above, modules begin with their own encapsulation, events, all sorts of races, a la "who ate the apple, you or the enemy",
What to study - at first, just basic OOP, in order to understand what to build a program from, what an object, class, interface, inheritance, polymorphism are (the same zhrachka can be of several types, for example, but it is "eaten up" in the same way), encapsulation ( a la "do not go into my properties with your paws"). All these SOLID and other abbreviations, as well as patterns and anti-patterns, will appear in the process when you move from architecture to the design of the entities themselves and writing the code of methods. I think so.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question