Читать книгу Rethinking Prototyping - Группа авторов - Страница 108

6 Object-Oriented Programming, with User-Defined Classes

Оглавление

A further progression in sophistication is to create a solution space of design alternatives. In this example, the compact, associative model building code has been repackaged as the constructor of a user defined class (Fig. 10) and this class has then been instantiated with different values for two-driver variable, with the resulting design alternatives output as a 2D array (Fig. 10). This process of repackaging of existing code or code refactoring is itself an interesting example of the progression the designer may make. Starting initially with a more open-ended and exploratory style of programing, the designer can progress to a more formal software engineering approach which may be more suited to design documentation and re-use.


Fig. 10 The original associative ‘model building’ code is re-used as a constructor for new class


Fig. 11 A solution space has been generated by instantiating a user-defined class with a range of values for two different driver variables (number of columns in X and X height) to create a 2D solution space.

Rethinking Prototyping

Подняться наверх