The interface design has five principles:
- Unified: An interface should define a consistent abstraction with a clear unifying theme. If a function does not fit that theme, it should be defined elsewhere.
- Simple: To the extent that the underlying implementation is itself complex, the interface must seek to hide that complexity from the client.
- Sufficient: When clients use an abstraction, the interface must provide sufficient functionality to meet their needs. If some critical operation is missing from an interface, clients may decide to abandon it and develop their own, more powerful abstraction. As important as simplicity is, the designer must avoid simplifying an interface to the point that it becomes useless.
- General: A well-designed interface should be flexible enough to meet the needs of many different clients. An interface that performs a narrowly defined set of operations for one client is not as useful as one that can be used in many different situations.
- Stable: The functions defined in an interface should continue to have precisely the same structure and effect, even if the underlying implementation changes. Making changes in the behavior of an interface forces clients to change their programs, which compromises the value of interface.
Project (random.h design): RandTest.cpp, random.cpp and random.h.
- <string> library exports a classed string that represents a sequence of characters.
- <cctype> library exports several functions for working with individual characters.
later code will use '*.hpp' as header file suffix to make this C++ project consistency.
https://web.stanford.edu/dept/cs_edu/resources/textbook/Reader-Beta-2012.pdf