Developer Revelation

    We are constantly dealing with MVC in the process of developing websites on frameworks. And each time starting a new project, the developer hopes to make it better than the previous one, to apply in his new release all the accumulated development experience. Sometimes a developer tries to master other, new for himself, frameworks that are most consistent in their fashion. And on the contrary, adhering to more conservative views, they try to “use” their familiar framework. One way or another, the developer has to write his own libraries, modules or implement ready-made solutions. The conclusion immediately begs: "there is no particular reason to chase the framework."

    Every right developer deeply hopes that his project will not die and will not become dusty in the raid array of any Cloud on a "nameless" hosting. But, as a rule, the developer himself does not want to engage in supporting the completed project in the future, especially when his potential is now directed towards developing a new interesting project. But there is another category of developers whose main task is to support and develop the project after putting it into operation, and these specialists were not always directly involved in the development process before the project went into operation. Therefore, we continue the last conclusion: "..., it is enough to opt for a popular, well-documented framework with an advanced community of developers or with a" rich dad ", such as Zend."

    However, do not forget about the need for the competent use of various libraries and technologies. But the most important thing is to choose the right approach to development. Now, probably, any developer understands the necessity of using "Development Images" in modern web-projects. Perhaps someone will disagree, and will argue that the use of "design patterns" and even OOP is too redundant, in terms of performance, processor and memory resources are not optimally used, and that it is too "cool" for the web, especially if the code is then processed by the interpreter, and that complicates the process of debugging the code. To some extent, all this is so. But, as practice shows, the problem of lack of processor resources is usually in last place when it comes to large web-projects with huge traffic, such as, for example, Facebook Under the conditions of “High Load”, as it is fashionable to say, the main problems are reduced, banal, to the number of revolutions of the spindle motor of a hard drive per second, thanks to the “storm” of database queries continuously received from users of the World Wide Web. Highly loaded projects, as you know, require horizontal scaling of the project database to multiple clusters in one or more data centers. And the resources of RAM are almost completely spent in order to cache data. The conclusion is: "you should not save on the flexibility of developing a web-project and its further support, which is guaranteed by the use of Design Patterns." thanks to the “storm” of database queries continuously coming from users of the World Wide Web. Highly loaded projects, as you know, require horizontal scaling of the project database to multiple clusters in one or more data centers. And the resources of RAM are almost completely spent in order to cache data. The conclusion is: "you should not save on the flexibility of developing a web-project and its further support, which is guaranteed by the use of Design Patterns." thanks to the “storm” of database queries continuously coming from users of the World Wide Web. Highly loaded projects, as you know, require horizontal scaling of the project database to multiple clusters in one or more data centers. And the resources of RAM are almost completely spent in order to cache data. The conclusion is: "you should not save on the flexibility of developing a web-project and its further support, which is guaranteed by the use of Design Patterns."

    What I do not recommend using when building an object model for a web project: avoid multiple inheritance - this is far from cool and not at all flexible.
    Disadvantages of multiple inheritance:
    • there is no 100% guarantee of obtaining the correct result when crossing elements (properties, methods) of data structures of different types (classes), the developer always has to remember these classes;
    • Abusing inheritance in general (not only multiple), we get a bulky class that combines many methods and properties of their own ancestors, some methods and properties of which are probably not even needed in the descendant class; objects of such classes can be very redundant;
    • the flexibility of maintaining the class is lost, when you need to change one of the ancestor classes, you need to change all or some of the descendants;
    • if it becomes necessary to create a set of objects similar in functionality, but at the same time requiring a different set of all ancestor classes, or if the sequence of inheriting ancestor classes of such objects will be different, then in this case it will be necessary to create a class for each such object that will differ from others, only by the sequence of inheritance of the ancestors or their composition.
    Imagine: If each class will be responsible for the derivation of one specific letter of the alphabet, then, under the conditions of inheritance, to build each different phrase, you will need to write a separate class that will inherit all classes of letters of the alphabet in its composition. The result is a sea of ​​classes, and this is not very flexible. If inheritance is not flexible, then how can it be replaced? Answer: inheritance. But the inheritance is not of classes, but of objects of different classes, this is stated by the basic law of object-oriented design. “Different” - not completely different, all these objects will implement one interface. This approach is implemented by the “Composite” pattern and covers all the disadvantages of class inheritance, while adding the ability to dynamically add / remove inheritance components, move them from “node to node”, dynamically change their behavior and add new properties. The only drawback of Composition is the difficulty in debugging. I recommend using the “Composite” pattern when building the “View”, if the framework does not provide such an opportunity, then it is not difficult to implement your “Composite View”.

    Also popular now: