Tus comentarios
Thanks for the suggestion and examples, Gillian! I'll keep this in mind for future versions of design patterns content. I'm fond of the exercies as well.
Thank you for reporting this issue. I fixed it and sent the updated version to deployment. It'll be live in half an hour. Thanks again!
我已经解决了这个问题。 请从您的帐户下载该书的新版本。 再次感谢!
你好! 感谢您的举报,我将再次检查Kindle的格式。
Здравствуйте, Сергей!
Спасибо за хороший вопрос. В какой-то степени, да, противоречит. В то же время, от разделения может и не быть очень большого выигрыша. Принципы SOLID не являются чем-то высеченным в камне.
Если у вас есть небольшой класс для работы с отчетами, в котором есть фабричный метод, то выделив всю фабричную часть в отдельный класс вы точно сделаете код сложнее, но не факт, что этим будет удобнее пользоваться.
Hi Israel!
The book itself is language agnostic, the code snippets given in the book are in pseudocode. However, the book comes with an archive that contains actual examples in 8 programming languages (C#, C++, Java, PHP, Python, Ruby, Swift, TypeScript), all extensively documented with code comments.
As the name suggests, pseudocode generally does not actually obey the syntax rules of any particular language; there is no systematic standard form. Using pseudocode is a pretty common thing in education to explain general concepts. As far as I remember, I borrowed syntax from some of the examples on wikipedia and stuck to it throughout the whole book. Here's some more info about pseudocode: https://en.wikipedia.org/wiki/Pseudocode
Why did I use pseudocode at all?
1) While I think that most people would understand the Java or C# syntax as well, any book that uses specific programming language is automatically perceived as tailored for that language. However, I wanted my book to be language agnostic. It's easy to do on the web version, because you can produce quick language switchers for code examples, but not as easy for static ebooks. With that said, I also know that some code examples were needed anyway. Therefore I used pseudocode and supplied the archive with real code examples along with the book.
2) While I might produce special versions of the book with real examples in the future, there's another problem with this approach. Some languages just lack decent examples for specific patterns due to special features that they have out of the box or non-existent applications for that language. But I think people should need about those patterns anyway, since, who knows, one day you might be a PHP developer and tomorrow life might switch you to C#.
I hope this all makes sense. Let me know if you have further questions.
Thanks for the compliments! I'm glad that you like it here.
Actually, we're almost finished with it. The Polish version will be released by mid-June.
Servicio de atención al cliente por UserEcho
嗨!
感谢您举报! 您能发送拉取请求吗?
https://github.com/RefactoringGuru/design-patterns-java/tree/master/src/refactoring_guru/adapter/example