Introduce Foreign Method
From CSSEMediaWiki
(Difference between revisions)
Brett Ward (Talk | contribs) (Page Outline Added) |
m (Reverted edits by Ebybymic (Talk); changed back to last version by Brett Ward) |
(One intermediate revision by one user not shown) |
Latest revision as of 03:22, 25 November 2010
Sometimes you'll have some brilliant class that is missing a feature or method, but cannot alter the source code. Instead, the lack of method must be coded around.
To do this, you add the method in the client class that would like the functionality from the server class you cannot alter. The method should not access anything in the client class, and send values in as parameters if needed. The first parameter should be the server class.
If it becomes the case that a server class needs several foreign methods, or many classes are using the same foreign method, Introduce Local Extension should be used instead.
See Also