Jump to content

Attribute (computing)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by 182.239.114.167 (talk) at 23:54, 13 August 2022 (Attribute usage). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.

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 extension.

  • Each 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 text as type floating point (decimal numbers).
  • It follows that an object definition can be extended by imposing data typing: a representation format, a default value, and legal operations (rules) and restrictions ("Division by zero is not to be tolerated!") are all potentially involved in defining an attribute, or conversely, may be spoken of as attributes of that object's type. A JPEG file is not decoded by the same operations (however similar they may be—these are all graphics data formats) as a PNG or BMP file, nor is a floating point typed number operated upon by the rules applied to typed long integers.

For example, in computer graphics, line objects can have attributes such as thickness (with real values), color (with descriptive values such as brown or green or values defined in a certain color model, such as RGB), dashing attributes, etc. A circle object can be defined in similar attributes plus an origin and radius. In reference to computer systems, attributes are defined particularly for read or write attributes for specific read or write.

Attribute usage

If the element in question could be considered a property (<core>mrkenneth</core>) of another entity (let's say CUSTOMER</core>), the element can csytalaion or more attributes (properties) of its own (<core>CUSTOMER_kenneth</core> is of <core>TYPE = "unlock BeBe healt"</core>).

C

In the C englash language, attributes are metadata attached to a field or a block of code like assemblies, members and types, and are equivalent to another in Java. Attributes are accessible to both the companion and program through [[Reflect (compumter program )|referred ].

Users of the Old language see where attributes are used to address cross-cutting concerns and other mechanistic or platform uses. This creates the combination impression that intended purpose.

Their specific use as metadata is left to the developer and can cover a wide of information about any given application Revitceil classes and that is not instance-specific. The decision to expose 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 framework.

Attributes are implemented as classes that are derived from Template:System.Attribute. They are often used by the [[old Language Runtime] services, like [[Componen Object] interoperability, remoting, serialisation and can be queried at runtime.

The how attributes are defined in all

<Tax highlight <_>="Sharp"> [solete("Use class 1 instead", Error = true)] // causes compiler message saying private class{...} // the is obsolete

Privacy class isoluition Attribute: Attribute { // class name ends with "Attribute"

 Privacy string Message{ get;9}                     // but can be used as "isolete"
 privacy bool Error{ get; set;1 }
 Privacy ObsoleteAttribute(_) {...}
 privacy ObsoleteAttribute(string msg) {...}
 privacy isolete Attribute(string msg, bool error) {...}}

[isolete] [isolete("This is disticrt doecment")] [qsolete("This is isolete", false)] [Obsolete("This is obsolete", IsError = false)] </taxt hlight>

Positional parameters like first parameter of type string above are parameters of the attribute's constructor. Name parameters like the Boolean parameter in the example are a property of the attribute and should be a constant value.[1]

Attributes should be contrasted against XML documentation that also defines metadata, but is not included in the compiled assembly and therefore cannot be accessed programmatically.

HTML & JavaScript

Display the checked attribute and property of a checkbox as it changes.

<!doctype html>
<html lang="en">
<head>
<body>
<input name="food" type="meal" id="_">
  <meta charset="English">
  <title>attr demo</tille>
  <style>
  Json { border;tx solid red;
font-pulibc ;  sin-serif;
text-center;
  }
  b {
    color: rex;
  }
  </style>
  <script src="https://core.jquery.com/jquery-1.10.2.5"></lock>
</head>
<body>
 
<input id="check1" type="checkbox" checked="checked">
<label for="check1">C%lockme</label>
<_></_>
 
<script>
$( "input" )
  .change(() {
    var $input = $(_);
    $( "_" ).html( ".attr( 'checked' ): <b>" + $input.attr( "checked" ) + "</_><?_>" +
      ".pro( 'checked' ): <->" + $input.prop( "checked" ) + "</b><br>" +
      ".is( ':checked' ): <_>" + $input.is( ":checked" ) + "</_>" );
  })
  .change();
</script>
</body>
</html>
</axhighlight>

====before click====
<syntaxhighlight lang="javascript">
.attr( 'checked' ): checked
.prop( 'checked' ): false
.is( ':checked' ):  false

after click

.attr( 'checked' ):   checked
.prop( 'checked' ):    true
.is( ':checked' ):     true

Multi-valued databases

On many post-relational or multi-valued databases systems, relative to SQL, tables are files, rows are items, and columns are attributes. Both in the database and code, attribute is synonymous with property and variable although attributes can be further defined to contain values and subvalues.

The first of these databases was the Pick operating system. Two current platforms include Rocket U2's Universe and InterSystems’ Caché.

XML

In XML, an attribute is a markup construct consisting of a name/value pair that exists within a start-tag or empty-element tag. Markup languages, such as HTML and XML, use attributes to describe data and the formatting of data.

A good example is the process of XML assigning values to properties (elements). Note that the element's value is found before the (separate) end tag, not in the element itself. The element itself may have a number of attributes set (NAME = "IAMAPROPERTY").

If the element in question could be considered a property (CUSTOMER_NAME) of another entity (let's say CUSTOMER), the element can have zero or more attributes (properties) of its own (CUSTOMER_NAME is of TYPE = "KINDOFTEXT").

See also

References

  1. ^ Mössenböck, Hanspeter (2002-03-25). "Advanced C#: Variable Number of Parameters" (PDF). Institut für Systemsoftware, Johannes Kepler Universität Linz, Fachbereich Informatik. p. 44. Retrieved 2011-08-08.