Új hozzászólás Aktív témák

  • zserrbo

    aktív tag

    Design pattern témakörben merült fel a subject class kifejezés. Lehet buta kérdés, de hogyan fordítanátok magyarra?

    Ebből a könyvből van a 124-125. oldalon.

    "In the FunPaint application, let’s assume that a class (say ShapeArchiver) is responsible for archiving
    information about all the drawn shapes. Similarly, another class (say Canvas) is responsible for displaying all
    drawn shapes. Whenever any change in shapes takes place, you need to inform these two classes as to the changed information. "
    .
    (itt szerepelnének a kódok)
    .
    "Well, this implementation works as intended—but there is a problem. There is a tight coupling between the subject (Circle class) and both of the observers ( ShapeArchiver and Canvas). Here are the consequences of a tightly coupled design:
    The subject class (Circle) knows about the specific observer classes. As a result, if you change
    observer classes, you need to change subject class, too. (Hmm, not so good.)"

Új hozzászólás Aktív témák

Hirdetés