The routines introduced in the preceding chapters have been introduced mainly to illustrate features of the Eiffel language. The role of a routine in object-oriented programming ought now to be clarified: in the context of object-oriented development the routine is a secondary concern, whereas in the context of process-oriented development it has a major role in decomposing a problem into manageable small tasks;in object-oriented software development, data is given a more privileged position, whereas functions and sub-functions are the primary organising idea in traditional software development;the primary focus in object-oriented software development is on the classes of objects in the system being modelled;classes provide a combination of state and behaviour, and externally may be viewed as collections of data and services;in the context of Eiffel, routines are features of a class which if public, are used to provide the services required by clients, or if private are used to perform auxiliary tasks necessary to satisfy the requests of clients;in pure object-oriented languages such as Smalltalk and Eiffel, routines, or ‘methods’ as they are known in Smalltalk, are associated with a particular class, and can be invoked only when sending a message to an instance of that class.
Weitere Kapitel dieses Buchs durch Wischen aufrufen
Bitte loggen Sie sich ein, um Zugang zu diesem Inhalt zu erhalten
Sie möchten Zugang zu diesem Inhalt erhalten? Dann informieren Sie sich jetzt über unsere Produkte:
- Eiffel Routines
A. J. Tyrrell
- Macmillan Education UK
Neuer Inhalt/© ITandMEDIA