Παράδειγμα Demeter


class Demeter {
    private A a;
    private int myFunc() { /* ... */ }
    public void example (B b) {
        C c = new C();
        int f = myFunc();

        // ...
        b.paramMethod();
        a = new A();
        a.createdMethod();
        c.ownMethod();
    }
}