Type generalization

Generalize type
Type generalization is a technique commonly used in refactoring.wikipedia
10 Related Articles

Code refactoring

refactoringrefactoredrefactor
Type generalization is a technique commonly used in refactoring.

Object-oriented programming

object-orientedobject orientedobject-oriented programming language
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.

Spaghetti code

Lasagna code("spaghetti") codemonolithic
Too-general code can, however, become completely useless, leading to spaghetti code doing effectively nothing.

Data type

typedatatypetypes
Type generalization refers to making more general or more abstract some subset of the traits of a specific type.

Method (computer programming)

methodsmethodabstract method
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.

Class (computer programming)

classclassesPartial class
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.

Java (programming language)

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

Object (computer science)

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

Interface (computing)

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