'. '

Visitor18

From APIDesign

Revision as of 13:13, 2 March 2018 by JaroslavTulach (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Does any new feature of JDK8 change the way people shall write visitor"?

The solution to the expression problem presented at the visitor page (and also Chapter 18 of TheAPIBoook) is another realization of the general principle to separate ClientAPI from ProviderAPI. Client part of the visitor can be enriched by adding new dispatch methods (into final class) with each new version. The interface part of visitor is immutable, a fixed point, which stays the same for those who implement it. Each version defines its own unique interface (according to the list of expression types it supports). The internals of the API then bridge the dispatch methods to appropriate interface visit methods.

Personal tools
buy