Abstract
Polymorphism enables code to be more abstract. When your code references an interface instead of a class, it loses its coupling to that class and becomes more flexible in the face of future modifications. Such abstraction is not possible with class constructors. This chapter examines the techniques of object caching and factories, which help the designer to restrict constructor usage to a small, well-known set of classes.
This is a preview of subscription content, log in via an institution.
Buying options
Tax calculation will be finalised at checkout
Purchases are for personal use only
Learn about institutional subscriptionsAuthor information
Authors and Affiliations
Rights and permissions
Copyright information
© 2019 Edward Sciore
About this chapter
Cite this chapter
Sciore, E. (2019). Encapsulating Object Creation. In: Java Program Design. Apress, Berkeley, CA. https://doi.org/10.1007/978-1-4842-4143-1_5
Download citation
DOI: https://doi.org/10.1007/978-1-4842-4143-1_5
Published:
Publisher Name: Apress, Berkeley, CA
Print ISBN: 978-1-4842-4142-4
Online ISBN: 978-1-4842-4143-1
eBook Packages: Professional and Applied ComputingProfessional and Applied Computing (R0)Apress Access Books