Tus comentarios

Здравствуйте!

Прошу прощения за задержку с ответом. Материалы курса не заточены под конкретный язык, поэтому если вы можете читать C#, Java или PHP, то курс для вас будет всё-равно полезен, т.к. в нём раскрываются общие техники рефакторинга ООП кода.

Прошу прощения за оформление ответа, надеюсь псевдокод выше хоть немного понятен.

Здравствуйте, Евгений.

Это очень хороший вопрос. Ниже — моё личное мнение, я не могу говорить за GoF. Полагаю, они имели в виду что-то вроде этого:

abstract class AbstractFactory
    abstract method createProductA: ProductA
    abstract method createProductB: ProductB

class ConcreteFactoryViaPrototypes extends AbstractFacotry is
    field productAPrototype: ProductA
    field productBProtype: ProductA

    constructor ConcreteFactoryViaPrototypes(productA, productB)
        productAPrototype = productA
        productBProtype = productB

    method createProductA():ProductA is
        return productAPrototype.clone()

    method createProductB():ProductB is
        return productBPrototype.clone()

Клиент, вместо того, чтобы создавать несколько разных подклассов ConcreteFactory, имеет лишь один, и уже в клиентском коде настраивает разные фабрики под свои нужды.

modernFactory = new ConcreteFactoryViaPrototype(modernChairObject, modernCouchObject)
classicFactory = new ConcreteFactoryViaPrototype(classicChairObject, classicCouchObject)

Hi!

Thanks for the question!


The Client should be able to deal with the Proxy and the Service directly. Proxy and Service should be interchangeable within the Client. For this to happen in most programming languages, the Proxy and Service classes should have some kind of common interface, be that the actual interface, or a common base class.

Please let me know if you have further questions.

Спасибо! Поправлю со следующим обновлением.

All right, I'm finally ready to actually start this project. We'll start with design patterns, the website, and the book. According to my past localization experience, it will take around 4 months to complete, so stay tuned.

Right now I'm building a pool of candidates from whom I'll select the primary translator and editor. If anyone is willing to take one of these roles, you're free to apply to this job: https://www.upwork.com/jobs/~01477fa43c393b33c0


On the other hand, I'd be also very grateful for beta-review of the results, once they'll be ready. I assume that everyone who commented in this thread is okay with that, so I'll notify you guys when I have something ready to be reviewed. If anyone else wants to participate, just shoot me an email to support@refactoring.guru

Здравствуйте, Иван!

Да, я планирую издать ещё одну работу о не-GoF паттернах в будущем. Касательно помощи, у вас есть какие-то существующие статьи, публикации, блог или что-то в этом роде?