In Object Oriented programming, you'll have certain named blocks of code (usually known as methods) that you can perform on specific objects (type A), and others that you can perform on all the objects of a particular type (type B).
Example.
If I had a class called sandwich, I might have one method called getFilling and another called getBread which return me information as to whether a particular sandwich is Beef or Cheese, and whether it's on brown or white bread. These methods are both Type A as their actions will vary depending on which sandwich they're run.
However, if I have a method called getCount that returns me a total of the number of sandwiches I have, then it's going to return me the same value whether I call it on my "Beef and Stilton on White", or on a Plain cheese sandwich in brown bread. So that's an example of a Type B.
Type B methods are sometimes known as
Class methods since they apply to the class as a whole. You'll also find that Java programmers refer to them as
static methods, and Python fans call them
unbound methods since they're not attached (bound) to any particular single instance of an object.
Type B methods, then, may be known as
Object methods as they apply to an individual object,
dynamic methods as they change in behaviour depending on which particular object they're called on, or
bound methods because their behaviour is bound to a certain object.
(written 2005-10-25 14:47:07)
Associated topics are indexed under
Y112 - Python - Objects - IntermediateY106 - Object Oriented PythonJ706 - Java - Objects and ClassesQ909 - Object Orientation and General technical topics - Object Orientation: Composite Objects
Some other Articles
PHP upgrade - traps to watchNew look to websiteNew servlet from oldWatch what you wearClass, static and unbound variablesMay I be politically incorrect?Where to stay in and near MelkshamVintage Bus DayLooking different in townAre you free on 29th October - Charity ball