Sunteți pe pagina 1din 1

In 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 clarity, attributes should more correctly be considered metadata. An attribute is frequently and generally a property of a property. However, in actual usage, the term attribute can and is often treated as equivalent to a property depending on the technology being discussed. An attribute of an object usually consists of a name and a value; of an element, a type or class name; of a file, a name and e tension. !ach named attribute has an associated set of rules called operations" one doesn#t sum characters or manipulate and process an integer array as an image object$ one doesn#t process te t as type floating point %decimal numbers&. It follows that an object definition can be e tended by imposing data typing" a representation format, a default value, and legal operations %rules& and restrictions %'(ivision by )ero is not to be tolerated*'& are all potentially involved in defining an attribute, or conversely, may be spo+en of as attributes of that object#s type. A ,-!. file is not decoded by the same operations %however similar they may be$these are all graphics data formats& as a -/. or 01- file, nor is a floating point typed number operated upon by the rules applied to typed long integers. For e ample, in computer graphics, line objects can have attributes such as thic+ness %with real values&, color %with descriptive values such as brown or green or values defined in a certain color model, such as 2.0&, dashing attributes, etc. A circle object can be defined in similar attributes plus an origin and radius. 3ontents 4hide5 6 Attribute usage 6.6 37 6.8 1ulti9valued databases 6.: ;1< 8 =ee also : 2eferences Attribute usage4edit5 374edit5 In the 37 programming language, attributes are metadata attached to a field or a bloc+ of code li+e assemblies, members and types, and are equivalent to annotations in ,ava. Attributes are accessible to both the compiler and programmatically through reflection. >sers of the language see many e amples where attributes are used to address cross9cutting concerns and other mechanistic or platform uses. ?his creates the false impression that this is their sole intended purpose. @ith attributes, it is possible to e tend attributes such as abstract, sealed, or public.465 ?heir specific use as metadata is left to the developer and can cover a wide range of types of information about any given application, classes and members that is not instance9specific. ?he decision to e pose any given attribute as a property is also left to the developer as is the decision to use them as part of a larger application framewor+. Attributes are implemented as classes that are derived from =ystem.Attribute. ?hey are often used by the 3<2 services, li+e 3A1 interoperability, remoting, serialisation and can be queried at runtime. ?he e ample shows how attributes are defined in 37"

S-ar putea să vă placă și