Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Composite Attribute

Is there any way of making a composite attribute in C# to provide equivalent metadata at compile time?

E.g, change:

[ClassInterface(ClassInterfaceType.AutoDual)]
[ProgId("MyProgId")]
[MyMefExport("MyProgId")]
public class MyClass
{
}

To:

[MyCompositeAttribute("MyProgId")]
public class MyClass
{
}
like image 976
devdigital Avatar asked Nov 21 '12 16:11

devdigital


People also ask

What is an example of a composite attribute?

A composite attribute consists of a group of values from more than one domain. For example, the Address attribute consists of several domains such as house number, street number, city, country, etc. What is the primary attribute of composite numbers?

What is a composite attribute in DBMS?

What is a composite attribute in DBMS? The attributes that cannot be divided into sub-parts are called simple attributes. The attributes which can be divided into sub-parts are called composite attributes. Let’s consider an example of how to convert Entity Relationship (ER) model of composite attribute to Relational model.

What are composite attributes in Entity Framework?

The attributes which can be divided into sub-parts are called composite attributes. Let’s consider an example of how to convert Entity Relationship (ER) model of composite attribute to Relational model.

What is the difference between composite and multivalued attribute?

In ER diagram, composite attribute is represented by an oval comprising of ovals. 3. Multivalued Attribute – An attribute consisting more than one value for a given entity. For example, Phone_No (can be more than one for a given student).


1 Answers

Attributes in and of themselves are meaningless. It is the code that enumerates the attributes attached to a class that may change its operation.

If you control the code that understands the attribute, you could create a composite attribute and act as though multiple separate attributes were applied.

That being said, I doubt you control ProgId nor the C# compiler that interprets it...

like image 95
Mitch Avatar answered Oct 29 '22 06:10

Mitch