Design and specification of iterators using the swapping paradigm
- 1 August 1994
- journal article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Software Engineering
- Vol. 20 (8) , 631-643
- https://doi.org/10.1109/32.310672
Abstract
How should iterators be abstracted and encapsulated in modern imperative languages? We consider the combined impact of several factors on this question: the need for a common interface model for user defined iterator abstractions, the importance of formal methods in specifying such a model, and problems involved in modular correctness proofs of iterator implementations and clients. A series of iterator designs illustrates the advantages of the swapping paradigm over the traditional copying paradigm. Specifically, swapping based designs admit more efficient implementations while offering relatively straightforward formal specifications and the potential for modular reasoning about program behavior. The final proposed design schema is a common interface model for an iterator for any generic collection.Keywords
This publication has 15 references indexed in Scilit:
- ON SPECIFICATION OF REUSABLE SOFTWARE COMPONENTSInternational Journal of Software Engineering and Knowledge Engineering, 1993
- The property vector specification of a multiset iteratorPublished by Institute of Electrical and Electronics Engineers (IEEE) ,1992
- Reusable Software ComponentsPublished by Elsevier ,1991
- An Approach for Constructing Reusable Software Components in AdaPublished by Defense Technical Information Center (DTIC) ,1990
- Specification of iteratorsIEEE Transactions on Software Engineering, 1990
- Parameterization: a case studyACM SIGAda Ada Letters, 1989
- Efficient high-level iteration with accumulatorsACM Transactions on Programming Languages and Systems, 1989
- Designing families of data types using exemplarsACM Transactions on Programming Languages and Systems, 1989
- Abstraction mechanisms in CLUCommunications of the ACM, 1977
- Abstraction and verification in AlphardCommunications of the ACM, 1977