官术网_书友最值得收藏!

Understanding the separation of concerns

Each of these different aspects is a problem of its own, and trying to solve all of these issues at once would be quite a headache. One of the most important concepts to learn as a developer is the idea of compartmentalizing problems, and breaking them apart into simpler and simpler pieces until they're all manageable. In computer science, there is a design principle known as the separation of concerns which deals with this issue. In this aspect, a concern would be something that will change the code of a program. Keeping this in mind, we would separate each of these concerns into their own distinct sections, with as little overlap in functionality as possible. Alternatively, we can make it so that each section solves a separate concern.

Now when we mention concerns, they are a distinct feature or a distinct section. Keeping that in mind, it can either be something as high level as an entire class or as low level as a function. By breaking apart these concerns into self-contained pieces that can work entirely on their own, we gain some distinct advantages. By separating each system and making it so they do not depend on each other, we can alter or extend any part of our project with minimal hassle. This concept creates the basis for almost every single design pattern that we'll be discussing.

By using this separation effectively, we can create code that is flexible, modular, and easy to understand. It'll also allow us to build the project in a much more iterative way because each class and function has its own clearly defined purpose. We won't have to worry nearly as much about adding new features that would break previously written code because the dependencies are on the existing functional classes, and never the other way around. This means we can to easily expand the game with things like Downloadable Content (DLC). This might include new game types, additional players, or new enemies with their own unique artificial intelligence. Finally, we can take things we've already written and decouple them from the engine so we can use them for future projects, saving time and development costs.

主站蜘蛛池模板: 寿光市| 崇仁县| 宁津县| 景德镇市| 同心县| 扶余县| 策勒县| 镶黄旗| 上杭县| 偏关县| 塔河县| 新野县| 宝兴县| 平凉市| 格尔木市| 延寿县| 建宁县| 清远市| 桂平市| 奉新县| 洪泽县| 象山县| 沂源县| 武平县| 石景山区| 谷城县| 永安市| 三门县| 天祝| 通江县| 进贤县| 灵武市| 潢川县| 洛浦县| 微山县| 苗栗县| 南漳县| 尼勒克县| 荣成市| 轮台县| 舟曲县|