Hey. Tell me the procedure for identifying repeatable code that exists in different classes. What are some problems (here I wanted to inflate the problem in more detail, for example, changing property variables)? If you need to isolate repeatable code within a single class, everything seems to be so clear: select the repeatable section of code into a separate method and use it.

Examples are interested in js or php.

    1 answer 1

    If correctly understood, then the following interests:

    1. Template "decorator"
    2. Delegation Template
    3. For JS - lending method