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

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.

主站蜘蛛池模板: 荣成市| 江源县| 荃湾区| 神农架林区| 侯马市| 岢岚县| 宁南县| 哈巴河县| 怀仁县| 徐水县| 汾西县| 玉林市| 和林格尔县| 酉阳| 琼海市| 藁城市| 芮城县| 定州市| 金沙县| 樟树市| 镶黄旗| 钦州市| 九龙城区| 姜堰市| 安龙县| 蒲城县| 正镶白旗| 垦利县| 苍溪县| 伊吾县| 澎湖县| 宝清县| 广丰县| 三明市| 民县| 景洪市| 璧山县| 金沙县| 重庆市| 扎囊县| 宜宾县|