CS 696: Advanced OO
| Strict form using Classes For C++ | slide # 2 |
| Some Comments By the Creators | slide # 4 |
Lieberherr, Holland, Riel, Object-Oriented Programming: An
Objective Sense of Style, OOPSLA 1988 Proceedings
class A
{
public:
B data;
B* moreData;
B safeGet() { return data; }
B* get() { return moreData; }
A() { moreData = new B(); }
}
class C
{
private:
A myData;
public:
void M1() { A.data.message(); }
void M2() { ( new B() )->message(); }
void M3() { A.safeGet().message(); }
void M4() { A.get()->message(); }
}
"In general, if the application concepts are well defined and the class
that implement those concepts are stable, such violations are
acceptable"