Friday, July 31, 2009

What is a component, class, and control in software development?

define, contrast and compare component,class,control

What is a component, class, and control in software development?
Component and control do not have a definite meaning. Various environments may attach different meaning to them. Generally, both of them would refer to a GUI element such as a button. This is especialy true of control, and component might have a broader meaning that applies also to non-GUI elements.





Class is much clearer. Classes are the foundation of all object-oriented programming languages, such as Java or C#. Briefly, a class is a blueprint for an object of some kind. It defines the data in objects of that type and the actions that can be taken on objects of that type. Although class is a common term, various languages describe the data and actions using different terminology. For example, the actions in Java classes are called methods, but in C++ they are often called member functions.





For example, a business might have a Customer class. The data would be things like name, adress, etc. The actions might be things like getFirstName(), setAddress(), etc. The class itself is not an object. Each actual customer would be an object of that class.





Components and controls are usually based on a class. Using a button again, it is usually an object of a Button class. The class is the blueprint; the actual button is an instance or object of that class.


No comments:

Post a Comment