15.4. General I/O Approach for the SRS Classes

Just as with almost every other aspect of programming, you can take more than one approach when installing an I/O capability into a program. You could, for example, define a single class that would define general I/O functions that are applicable to every conceivable class in the SRS, and you could write the SRS classes as subclasses of this super-IO class. This approach would maximize code reuse, but would result in fairly complicated and less readable code.

One of the oldest and most valuable bits of programming advice is "Keep It Simple, Stupid" (KISS). True, it's a bit insulting, but it's excellent advice nonetheless. When faced with two or more possible approaches to a programming problem, ...

Get Beginning C# 2008 Objects: From Concept to Code now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.