6
votes
Vote UpVote

The Visitor Pattern – Part 3

The Art of Delphi Programming – In Part 2 of this series we learned about a more flexible implementation of the Visitor Pattern that the traditional approach. But we can do better. When we have a usual class inheritance within our shape or whatever classes, it might be desirable to handle groups of classes with a common ancestor all the same. For now we have to implement each interface individually. A slight change does the trick. We introduce a visitor interface for TAbstractShape, make TAbstractShape.Accept not abstract. Then we change the Accept implementations of the derived shapes to first check the visitor ...
Favorite? Off-Topic? Uwe Raabe @ 2010-08-17 10:13

Statistics

Visits: 396
Votes: 6
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

devtux
Horbs
jamiei
ket555
Mohammed Nasman
Uwe Raabe
Subscribe:
Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News

Sponsor

 
Please login or register to use this functionality.
(click on this box to dismiss)