Attribute (computing)
Definition
In the realm of computing, an attribute is a specification that defines a property of an object, element, or file. It may also refer to or set the specific value for a given instance of such. For example, in computer graphics, color, position, and texture are each attributes of an image. Also in computing, attributes are the variables referenced in a program's code and can determine the behavior of a program.
Types of Attributes
There are various types of attributes in computing, including:
- Scalar attributes: These are attributes that have a single value at a time. They are the simplest type of attribute and include integers, real numbers, and Booleans.
- Composite attributes: These are attributes that are composed of multiple components, each with its own value. For example, an address attribute might be composed of street, city, state, and zip code components.
- Derived attributes: These are attributes whose values are derived from other attributes. For example, an employee's age might be derived from their birth date.
- Key attributes: These are attributes that uniquely identify an instance of an object or element. For example, in a database table, the primary key attribute uniquely identifies each record in the table.
- Multivalued attributes: These are attributes that can have multiple values at the same time. For example, a person's phone number attribute might contain multiple values if they have more than one phone number.
Attributes in Programming
In programming, an attribute is a changeable property or characteristic of some component of a program that can be set to different values. In the HTML language, an attribute is a changeable property of a web page element, set within the start tag of an element. Attributes affect the behavior of the program, but do not affect the core code of the program.
Attributes in Object-Oriented Programming
In object-oriented programming (OOP), attributes are data stored inside a class or instance and represent the state or quality of the class or instance. In short, attributes store information about the instance. Also in OOP, classes and objects have attributes. Attributes are data members (class variables and instance variables) and their values are instance-specific.
Attributes in Database Systems
In database systems, an attribute is a characteristic or property that can help to define or classify a particular entity. For example, in a database table, an attribute may be a column or field. Each record in the table would then be an entity, and the cells within the columns would be the attributes. Attributes in database systems can be required or optional, and can also be composed of other attributes.
Attributes in File Systems
In file systems, an attribute is a piece of metadata (data about data) that describes the properties or characteristics of a file. Some common file attributes include read-only, archive, system, and hidden attributes. The process of assigning attributes to files can help to organize and secure data.