From charlesreid1

Revision as of 16:52, 18 June 2017 by Admin (talk | contribs) (Created page with "Tree data structures provide a great application of many object-oriented programming principles. '''Abstract class interfaces''' allow you to impose a uniform interface for d...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Tree data structures provide a great application of many object-oriented programming principles.

Abstract class interfaces allow you to impose a uniform interface for different tree types or tree implementations, and have it all be transparent to the user.

Template method pattern is a pattern that involves creating functional hooks (before/after hooks), so-called "template methods". These are useful for doing things like customizing a tree traversal.

Generic type/template interfaces are useful for storing arbitrary data in trees - templated tree node classes are useful because the data stored in the tree is not usually material to the schema of the tree itself.