Questions tagged [attributes]
25 questions
19
votes
6 answers
A programming language that allows you to define new limits for simple types
Many languages like C++, C#, and Java allow you to create objects that represent simple types like integer or float. Using a class interface you can override operators and perform logic like checking if a value exceeds a business rule of 100.
I'm…
Reactgular
- 13,120
- 4
- 50
- 81
13
votes
1 answer
The advantage of using __attribute__((aligned( )))
I found in more than one SIMD program the instruction __attribute__((aligned(16))) . When I looked for an explanation I found
The keyword attribute allows you to specify special attributes of
variables or structure fields.
Apparently variables…
S.E.K.
- 165
5
votes
3 answers
Dynamically add/change attributes of values in C#
I want to tag the values of variables with a "quality" attribute that can be changed dynamically during my programs execution. My first thought was to abuse the standard attribute functionality by tagging the value with my custom quality attribute. …
Peter M
- 2,097
5
votes
2 answers
How multi-valued and derived attributes are denoted in crow foot's notation of ERD?
In Chen notation multi-valued attributes are denoted by double eclipse(oval) and derived attributes are denoted by dotted eclipse(oval), but how they are denoted in crow foot notation?
Also how associative entities are denoted in crow foot?
Saif Ullah
5
votes
1 answer
How can attributes/annotations be illustrated on a UML class diagram?
Many programming languages offer a way to annotate types.
For instance, in .NET this can be achieved by deriving a custom attribute class from System.Attribute and then annotating another type with this:
[AttributeUsage(AttributeTargets.Class,…
Lea Hayes
- 1,043
4
votes
3 answers
What to do with database foreign keys in an entity class?
I know that an attribute defines the state of an object. So, is it correct to keep attributes that don't define the state of an object of a class?
For example, I have an Employee class, which has these…
Rajeev
- 555
3
votes
3 answers
C# Coding Standard - Position of Attribute in relation to Target
I had thought that this was one of the few solved problems in C# coding standards / style; Attributes always appear on the line above the thing to which they are applied a la
[SomeClassAttribute]
class SomeClass
{
[SomeFieldAttribute]
bool…
satnhak
- 149
3
votes
3 answers
Referencing transient class attributes
I've just started dipping my feet into OOP.
Is it considered bad practice to have classes that reference attributes that depend on another function being called and thus may not exist (version 1)? I'm self-taught so trying to gauge what is…
Tim Kirkwood
- 177
3
votes
2 answers
Accessing properties from embedded objects as attributes of container class
In Python, I have a class C which embeds objects from classes A and B. Is it considered good practice to creates shortcuts from the properties of embedded objects of classes A and B as attributes of container class C?
The goal is to create a simpler…
Daniel Arteaga
- 141
3
votes
1 answer
Should I use multivalued attributes in conceptual modelling?
My team and I have designed a simple, affordable conceptual modelling language as part or a larger research project. This language is aimed to end users with little or no training in information technologies. It allows them to create class models…
CesarGon
- 2,941
3
votes
2 answers
Should I put the datatype of a class attribute in its name?
Most of my system's class attributes are just text, but in this case it makes more sense to place this particular class's attributes into one single hash (from a "keep the source code pretty" aspect). Basically, a list of attributes is returned, and…
yurisich
- 1,391
- 1
- 11
- 17
2
votes
2 answers
Why access the attributes of a Python class by reference?
Attribute references and instantiation
In this link, that is part of the official Python documentation, I have found the following information:
Class objects support two kinds of operations: attribute references and instantiation.
Attribute…
User051209
- 171
2
votes
2 answers
Creating an Instance of a Complicated Class
How do I create instances of classes which require a huge amount of components and attributes? Take for example a car. A car has hundreds of sub components each with their own specific properties. There would be thousands of parameters to pass or…
supertommy
- 129
1
vote
4 answers
A method for handling many runtime configuration parameters
Suppose I am developing a class which implements some high-level application logic. I want the "configuration"/"attributes" of this logic to be modifiable at run-time (with some default values). Some attributes may be read-only, others may be…
Patrick Wright
- 789
- 4
- 12
1
vote
2 answers
API - editing subset of attributes
Given a resource for which only its subsets of attributes can be edited, {E.g. invoice (resource) with a status (attribute) and paidAmount (attribute)}, in terms of API design, which amongst the following is the better approach:
PUT…
Opal
- 275