📜 ⬆️ ⬇️

Another book about patterns? Give two!

Hello, reader! I want to talk to you about design patterns. You know, this is such an old thing, which it was fashionable to write about at the end of the last century, and some fiends sometimes ask about them at interviews. I had the idea that it was time to think about them again, but this time to look at them in contemporary realities. Is there a more appropriate way to do this, except for how to take ... and write a book about it?




Why now and why about patterns? Over the past 20 years, quite a lot has happened with modern approaches to development. In the early nineties there was a boom of patterns, then the turn came of DI and “programming in configuration files,” then the hyip started around DDD, and at the same time, functional programming techniques began to gain popularity. Has all this made the patterns irrelevant? From my point of view, no, did not!
')
HYIP around patterns really passed, and it's time to look at them from the height of our experience. For one, the patterns have lost their relevance, and for the other, the singleton remains our everything. In my book, I want to take some pattern and examine it from all possible sides: see what it looks like in the book of the "gang of four", examine its "canonical" modern view, examine 3-4 typical C # implementations, think how it affects the design of the application, well, and look at examples of their use in the .NET Framework and in modern applications.

For example, if we talk about the godless Singleton, I will give 4 different implementations on the .NET platform, show you how the classic Singleton differs from the Ambient Context pattern, and show where and in what form it is applicable in the modern application.

Or I will take the factory method and consider it not only from the point of view of the classical implementation, but also answer the question whether the factory method violates a dictionary or a switch, but the principle of Open-Close. Then I will go to the Template Method and consider it in the context of inheritance problems and contract design principles, and then I will compare the classical Template Method with a specific implementation in C # based on lambda expressions .

When I take the Visitor, I will not only show where and when it is applied, but also tell about the well-known software engineering problem called expression problem , about typical approaches to extensibility in the worlds of object-oriented and functional programming, about the role of the Visitor pattern in the context of the principle Open / Closed.

I will talk about the “builders” not just with examples of class diagrams from the gang of four, but in a slightly different context, for example, to create test data for units and integration tests.

I want to not just talk about patterns, with boring canonical class diagrams, some of which can not be found in real code. I want to take the key GoF-patterns and show how they evolved, how they are usually implemented in C #, and how much they ate into the .NET Framework and our fingers.

And what am I doing this for? The fact is, dear reader, that I need your help. The publisher (represented by the publishing house Peter aka ph_piter ) is ready to take on this book, but he needs the opinion of the community about the relevance of its relevance (this is not ochepatka!). We are ready to sacrifice our time to the detriment of family and other interests, but business follows somewhat different principles.



So, dear comrades (and comrades), if you would like to see this book in print, then respond as a thread in the comments or in another convenient way.

ZY If the content of the book is needed, then I am ready to lay it out, although it will differ little from the content of the classic book of the gang of four, with some branches.

ZYY.Y. Thank you, Eid Peter aka ph_piter , who is ready to take on this business with me!

Source: https://habr.com/ru/post/230873/


All Articles