Contents:

Learn: Software Architect
Learn moreEvgeny Yolchev
An expert is a professional with deep knowledge and experience in a specific field. Experts play a vital role in various fields, such as science, technology, business, and the arts. Their skills and advice often form the basis for decision-making and strategy development. In today's world, experts are in demand for data analysis, research, and consulting, which contributes to the development and improvement of processes in various industries. Becoming an expert requires not only theoretical training but also practical experience that allows you to identify and solve complex problems. Expertise also includes the ability to share knowledge and teach others, which contributes to the dissemination of information and increases the overall level of competence in the community.

About the author
The author of this material has significant experience in the field of writing and editing content. His works cover various topics and genres, which allows him to create high-quality and informative texts. The author strives to provide readers with relevant and useful information, focusing on SEO optimization to improve the visibility of materials in search engines. Thanks to a deep understanding of audience needs, the author is able to adapt the style and tone of the text to convey ideas most effectively to the reader.
Senior iOS Developer at VKontakte. Previously, he worked as a full-stack developer, focused on backend and DevOps, and also managed the mobile development department. For three years, he taught iOS development at GeekBrains and served as the dean of the faculty. He is a member of the program committee of the Podlodka iOS Crew conference and runs a YouTube channel with video tutorials on Flutter. He is active on Twitter under the handle @tygeddar.
Links play an important role in the structure and navigation of websites. They help users navigate between pages and find the information they need. In the context of SEO, high-quality and relevant links help improve the visibility of a site in search engines. It is important to use both internal and external links. Internal links help distribute page weight and direct users to other sections of your site, while external links point to resources that may be useful to users and increase the authority of your content. Link optimization involves using keywords in link text, which also helps improve SEO. Proper link formatting and structure can significantly improve user experience and contribute to better search engine rankings.
I'm passionate about debating which architecture is the most effective. Perhaps this stems from my passion for perfection or my education in information systems architecture. It may also be that I don't want to waste time analyzing failed projects.
The MVC architecture holds a special place in my preference. In this article, I'll explain how it works and why I'm not enthusiastic about other architectural approaches such as MVVM, MVP, and VIPER. I recently also examined Flux and its implementation in Redux and came to the conclusion that I don't like this approach either. MVC provides a clear structure that separates data, logic, and presentation, making development and testing easier. Unlike other architectures that can add complexity, MVC maintains clarity and makes code easier to understand.
This article analyzes the author's Twitter thread, exploring the main ideas and themes raised in his messages. The author shares his unique perspective and experience, making the thread interesting and relevant for discussion. The thread focuses on key questions that users are concerned about, as well as possible solutions and recommendations. This approach allows for a deeper understanding of the problems being discussed and promotes constructive dialogue. The thread becomes a platform for the exchange of opinions and ideas, making it a valuable resource for subscribers and the wider audience.
What is MVC Architecture?
I first encountered the Model-View-Controller (MVC) architecture in 2009 while learning the Zend web framework. The framework's documentation explained that the Model represents the database, the View is the HTML template, and the Controller is the logic that retrieves data from the database, processes it, and places it in the template for subsequent delivery to the user. This architectural model significantly simplified web application development by separating data processing logic, information presentation, and user interaction. MVC has become the standard in web development, ensuring clean code and easy maintenance and scalability.
At the time, I was studying at university, writing term papers and developing pet projects. These projects featured complex layouts and intricate database structures, but the logic remained fairly simple. Despite this, I was satisfied with my approach to writing code, as it was clear and understandable. This development style allowed me to focus on improving my skills and understanding the fundamentals of programming.
I never considered the possibility of acting differently from what was indicated in the tool documentation and forum examples. I was happy with my approach and was not distracted by unnecessary thoughts.
Doubts about my approach arose after reading articles on Habr, which argued that logic should be integrated into the model to keep the controller as simple as possible. This led me to understand two versions of the MVC architectural model: thin and fat controller. Each of these approaches has its pros and cons, and it is important to choose the one that best suits the requirements of your project. A thin controller makes testing easier and code maintenance easier, while a fat controller can provide more flexibility in managing application logic.
I changed the structure of my project by moving logic from one file to another. However, no significant changes occurred. As a result, the code simply ended up in a new location, but the functionality remained the same.
After reading discussions online and analyzing my own thoughts, I came to the conclusion that I don’t like the “fat” model. It is preferable for the model to remain as a database, and the controller to continue managing the application logic. This approach provides a clear separation of responsibilities and makes the code easier to maintain and evolve.
Over time, the complexity of my projects increased, and the controllers became more unwieldy (though not as much as UIViewController in iOS). I tried to solve this problem by moving the logic into separate files, which I connected to the controllers. However, this did not lead to significant changes: the architecture remained the same, and the code was simply moved from one file to another.

Why MVC didn't work in my projects
In 2013, I switched to Laravel, learned the class autoloading mechanism in PHP, and delved into the basics of object-oriented programming. I also read Steve McConnell's Code Complete, which significantly expanded my knowledge of software development.
It became clear that it was impractical to combine all the code into a single file. Code and classes should structure the project, and some of its fragments are better taken out of the MVC architecture and placed in separate modules. This will increase reusability and simplify code maintenance. Separation into components improves manageability and promotes more efficient development.
From that moment on, I changed my approach to project development. I introduced a class hierarchy that organized the storage of logic, as a result of which the controller became more lightweight. It began to receive data from the database, pass it to various modules, receive the processing results, and send them to the HTML page. This new approach improved the code structure and simplified its maintenance, which positively impacted the performance and scalability of projects.
The project architecture was not optimal for complex systems, but it was ideal for my tasks. This approach ensured code readability and maintained the independence of various project elements, which contributed to efficient development and simplified support.
How I Built a VDS Server Management System
A qualitative leap in my career occurred when I switched from web development to backend. In this new role, I was required to design and develop a complex VDS server management system. In the process, I created APIs, developed plugins, and managed dependencies for them. I also used asynchronous code and supported multiple operating modes, interacting with the operating system and various software. The main goal of the project was to create the system core, as well as develop independent plugins that can effectively interact with each other.
In complex systems, it is impractical to transfer all data through a single controller. Therefore, each plugin develops separate web and API interfaces, which allows for efficient data access management and the implementation of business logic. These elements are organized into packages, which ensures their reuse and simplifies integration into the system, increasing its flexibility and scalability.
HTML and JavaScript interact with each other, providing models and communication with the API. In this structure, the API serves as a link, allowing the use of reusable packages to implement business logic and access data. This model does not quite correspond to the classic MVC architecture.
After switching to iOS development, I temporarily took a break from architectural issues. During this period, I focused on learning UIKit and intuitively placing interface components. HTML and CSS were transformed into various UIViews, and the thin controller became UIViewController. Business logic was implemented through services, which allowed for a more structured application.
Why Architecture Isn't the Most Important Thing in a Project
I was successful with the MVC architecture, but I was also exploring other approaches. Many people shared their impressions of how MVVM, MVP, and VIPER architectures made their work easier, so I decided to test them in my projects.
While observing how other companies implement their processes, I learned several key aspects.
Software architecture doesn't always provide clear advantages. No modern architecture has proven more effective than the methods I used in the initial stages of development. Over the course of my work, I've tried various approaches and been able to assess their true value for the project. However, between architectural patterns such as MVC and MVP, the difference lies only in class names and some rules for element interaction, not in their functionality.
Companies interpret architectural approaches differently. Some use MVVM, while others call the same approach MVC. I've encountered five different MVVM systems, and each had its own peculiarities. The exception is VIPER, which has detailed documentation and numerous examples thanks to the work of Egor Tolstoy. However, even in this case, implementation differences can be noticeable.
A popular architecture is not always the best choice for a project. Choosing an architectural approach based solely on its popularity can lead to ineffective solutions. For example, some developers choose MVVM but place the same components in different parts of the project, which can disrupt the logic and structure of the application. It is important to consider the specifics of the project, its requirements, and the characteristics of the team, rather than following fashion trends. The correct choice of architecture should be based on the functionality, maintainability, and scalability of the application.
Project architecture is not a panacea. It cannot independently solve problems and does not guarantee success. Key factors for a successful project are not only architectural decisions, but also effective management, high-quality planning, and competent implementation. Without a comprehensive approach, architecture remains only a theoretical basis that requires practical implementation and constant adaptation to changing conditions.
What is MVC really?
I constantly research software architectures, study literature, and discuss ideas with colleagues. I have rethought and changed my mind about the MVC model developed in Smalltalk many times.
I have come to the conclusion that the MVC architectural pattern is not simply a set of three files or classes for each component. The Model is not limited to data or business logic, and the Controller is losing its relevance. In modern web development, it is advisable to consider using MV (Model-View) to more efficiently organize code and improve interaction between components. This approach allows you to focus on the View and Model, which contributes to the creation of more flexible and scalable applications.
Applications with business logic and data access existed before the advent of MVC, but they lacked a full-fledged user interface. The main goal of MVC is to provide communication between the user interface and the rest of the application components. The creator of MVC recommends, if necessary, creating a separate facade for each View that will interact with the Model. It is also important to use the observer pattern to track changes and update data in the interface. This improves the application's structure, increases its scalability, and simplifies code maintenance.
The View represents the user interface, while the Model encompasses the rest of the application. The Controller's primary purpose is not to act as an intermediate layer between the View and the Model, but to effectively process user input. This approach allows for a clearer application architecture, with each component fulfilling its own unique role.
The MVC (Model-View-Controller) principle is to separate the user interface, business logic, and database interactions, providing a more structured and manageable approach to application development. This principle allows developers to focus on individual components without interfering with each other's functionality. The implementation of this approach is left to the discretion of the architect, who is responsible for designing the application's architecture. MVC is not a complex concept, but it requires careful planning for the system to function effectively.
MVP, MVVM, and VIPER do not replace the MVC architecture, but rather complement it. In modern applications, the controller is losing its former role, as input management is now handled directly through the view. This change makes the view an integral part of the architecture, promoting clearer separation of concerns within the application.
Apple's MVC, MVVM, and other architectural patterns are modifications of the view model. These variations often eliminate the controller, simplifying the application's structure. Among modern MV(x) patterns, MVVM is closest to the classic MVC model, while preserving the core principles of separation of concerns and simplifying interactions between components. MVVM allows for improved view state management and easier testing, making it a popular choice for developing modern applications.
Complex terminology can hinder communication, especially in the field of architecture. The primary goal of architecture is to simplify and improve understanding. Instead of confusing, architecture should make information more accessible and clear for everyone.

How to understand any architecture
Architecture They may seem monotonous, but this is a misconception. Each architecture has its own unique characteristics and requires careful study. I have several key principles that help in evaluating and understanding architectural solutions.
Implementation is a key aspect of a successful project. The overall architecture is not as important as its practical implementation. Class naming, element layout, and interactions between classes are important factors. To ensure project maintainability, the entire team should follow established standards. This approach improves code, increases its readability, and facilitates development and subsequent maintenance.
The model is your responsibility. The MVC architecture does not provide clear guidelines for creating the main part of the application. Your task is to avoid confusion in the model, where some classes perform service functions, and others perform auxiliary tasks. Properly structuring the model is critical to keeping the code clean and readable. Separate class responsibilities and adhere to single responsibility principles to ensure ease of maintenance and evolution of the application.
To successfully master programming, it is important to start with the fundamentals. Instead of focusing on a specific architecture, you need to understand the logical principles on which it is based. Knowledge of programming history and an understanding of object-oriented and functional approaches are helpful. Studying design patterns and SOLID principles will significantly deepen your knowledge. It is a must-read for Steve McConnell's book "Code Complete," which provides important guidance on writing high-quality code.
After mastering the basics, it is worth considering the Flux architecture and the Redux library. These technologies are worth considering, as Facebook has developed a detailed guide to Flux and released a corresponding library. It is interesting to note that Flux also follows the MVC principles, where the model (M) and view (V) are separated, and the view reacts to changes in the model. However, it is worth keeping in mind that there are additional restrictions that are interpreted differently. Studying these technologies will give you a deeper understanding of state management in applications and improve the quality of development.
Redux is a powerful tool for managing application state, but it is not without its drawbacks. While working on a project that I developed and maintained myself, I tried to adhere to best practices. I carefully chose the names of all components, linking only the initial scene to the Store, not all views. This helped avoid unnecessary complexity. I also grouped middleware and reducers, linking them to the application state. This approach helped optimize component interactions and provide a more understandable architecture.
At some point, I began to get lost in the project. I accumulated numerous entities with similar names and data, which led to the creation of a large number of actions. As a result, I became confused, not understanding which elements interact with each other and how they are related. Project management became complex and confusing, which negatively impacted its development and work efficiency.
The code was designed with extensibility and maintainability in mind, but any changes required editing numerous files, which created significant difficulties. This was especially exacerbated by the project's use of Flutter's boilerplate architecture, which increased the amount of work and complexity.
Redux is ideal for large, offline-focused projects where many asynchronous and non-blocking events occur simultaneously. In such cases, Redux-based boilerplate code is justified, as it significantly simplifies application state management and can prevent many problems. However, for typical thin-client projects, it makes more sense to use standard design patterns such as MV, which avoids unnecessary complexity and allows you to focus on developing functionality.
Conclusion: What to Read About Architecture
Application architecture plays a key role in its development and should be clearly understood by the entire team. When building an app with SwiftUI, I prefer the classic MV architecture, which implies that the View interacts with the Model. Many developers call this approach MVVM. I recommend following this principle to ensure clarity and ease of use when working on a project. A proper architecture not only simplifies the development process but also facilitates the maintainability and scalability of the application in the future. Habr offers excellent articles on the MVC pattern, such as "Hunting the Mythical MVC: An Overview, Returning to the Sources, and How to Analyze and Build Templates Yourself" and "Hunting the Mythical MVC: Building a User Interface." These materials are definitely worth studying for those interested in software architecture, as the author explains in detail and with examples the essence of MVC and its application in development.
Software Architect
You will get acquainted with the tools and best practices for building software architecture. Learn how to choose an architectural style for a specific business task, create scalable, fault-tolerant applications, and increase your income.
Learn more
