Every story and comment from the Hacker News API, in a layout borrowed from 2001.
A comment on C++ Patterns: The Badge.
In Java or C# (and of course in C++), you could have a token system where the token can only be provided by Device :
VFS: void register(DeviceToken):
DeviceToken: empty interface (marker)
Device: private DeviceToken provideDeviceToken();
This hides both VFS and Device classes from accessing each others' private members.
You can also constrain how gets to provide DeviceToken by adding sufficient comments in code.
There are no comments on this comment yet.
In Java or C# (and of course in C++), you could have a token system where the token can only be provided by Device :
VFS: void register(DeviceToken):
DeviceToken: empty interface (marker)
Device: private DeviceToken provideDeviceToken();
This hides both VFS and Device classes from accessing each others' private members.
You can also constrain how gets to provide DeviceToken by adding sufficient comments in code.