Type generalization

Type generalization

Type generalization is a technique commonly used in refactoring. The idea is to draw on the benefits of object-orientation and make more-generalized types, thus enabling more code sharing, leading to better maintainability as there is less code to write. Too-general code can, however, become completely useless, leading to spaghetti code doing effectively nothing.

Type generalization refers to making more general or more abstract some subset of the traits of a specific type. A superclass has wider use than a specific subclass, and so is more 'general'.

An example of generalizing a type would be moving a method from a child to a parent class for common use by all the parent class' children, not just the original child.

Another example, in the Java programming language, would be access to an object via an interface which isn't tied in to a specific implementation of that interface.


Wikimedia Foundation. 2010.

Игры ⚽ Нужно решить контрольную?

Look at other dictionaries:

  • Myers-Briggs Type Indicator — Carl Jung in 1910. Myers and Briggs extrapolated their MBTI theory from Jung s writings in his book Psychological Types. The Myers Briggs Type Indicator (MBTI) assessment is a psychometric questionnaire designed to measure psychological… …   Wikipedia

  • List of legendary creatures by type — This is a list of legendary creatures from mythology, folklore and fairy tales, sorted by their classification or affiliation. Creatures from modern fantasy fiction and role playing games are not included. Contents 1 Angels 2 Artificial creatures …   Wikipedia

  • ТИПОВОЕ ОБОБЩЕНИЕ — (type generalization) см. Идеальный тип …   Большой толковый социологический словарь

  • Database — A database is an organized collection of data for one or more purposes, usually in digital form. The data are typically organized to model relevant aspects of reality (for example, the availability of rooms in hotels), in a way that supports… …   Wikipedia

  • Szász-Mirakyan operator — In functional analysis, a discipline within mathematics, the Szász Mirakjan [Also spelled Mirakyan and Mirakian ] operators are generalizations of Bernstein polynomials to infinite intervals. They are defined by:left [mathcal{S} n(f) ight]… …   Wikipedia

  • Hindley–Milner — In type theory, Hindley–Milner (HM) (also known as Damas–Milner or Damas–Hindley–Milner) is a classical type inference method with parametric polymorphism for the lambda calculus, first described by J. Roger Hindley[1] and later rediscovered by… …   Wikipedia

  • Class diagram — UML diagrams Structural UML diagrams Class diagram Component diagram Composite structure diagram Deployment diagram Object diagram …   Wikipedia

  • analysis — /euh nal euh sis/, n., pl. analyses / seez /. 1. the separating of any material or abstract entity into its constituent elements (opposed to synthesis). 2. this process as a method of studying the nature of something or of determining its… …   Universalium

  • Glossary of Unified Modeling Language terms — This glossary of Unified Modeling Language terms covers all versions of UML. Individual entries will point out any distinctions that exist between versions.A* Abstract An indicator applied to a classifier (e.g., actor, class, use case) or to some …   Wikipedia

  • General relativity — For a generally accessible and less technical introduction to the topic, see Introduction to general relativity. General relativity Introduction Mathematical formulation Resources …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”