some issues in class DvProportion

Bug #611387 reported by Sergio Miranda Freire on 2010-07-29
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OSHIPpy
High
Unassigned

Bug Description

It seems that it is not necessary to test for the types of arguments in the initializer. On the other hand, the invarians below are not enforced. In implementing these invariants, the values in ProportionKind should be used:
Type_validity: valid_proportion_kind(type)
Precision_validity: precision = 0 implies is_integral
Is_integral_validity: is_integral implies (numerator.floor = numerator and denominator.floor = denominator)
Fraction_validity: (type = pk_fraction or type = pk_integer_fraction) implies is_integral
Unitary_validity: type = pk_unitary implies denominator = 1
Percent_validity: type = pk_percent implies denominator = 100

The initializer lacks the magnitudeStatus argument and so does the superclass initializer. Magnitude is not an attribute in this class, it is a method. It seems that it would be better to implement attribute as a method in DvQuantified.

The methods compare ("<") and isStrictlyComparableTo are not implemented.

The methods add, subtract and negate in DvAmount are not implemented.

It would be interesting to define a representation value for this class, wouldn't it?

Related branches

Changed in oship:
importance: Undecided → High
milestone: none → 1.5
affects: oship → oshippy
Changed in oshippy:
milestone: 1.5 → none
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers