Project

General

Profile

Feature #26

Remove getElement() from the Constraint interface - An easy fix, no prior mulgara-internals experience required.

Added by Andrae Muys - almost 16 years ago.

Status:
New
Priority:
Normal
Assignee:
Category:
Mulgara
Target version:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:

Description

Back in the distant past when the only type of Constraint supported was what we now refer to as [[ConstraintImpl]], getElement() was an ugly, but harmless way of obtaining the different elements of a constraint.
<br/>

<br/>
Now that we have dozens of different constraint types, the vast majority of which have to implement getElement() by throwing an exception, this is not so harmless.
<br/>

<br/>
It would be great if someone could go through the codebase and:
<br/>

<br/>
1) Add getSubject(), getPredicate(), and getObject() to [[ConstraintImpl]]
<br/>
2) Find each call to [[ConstraintImpl]]::getElement(), and replace with the appropriate call (element 0-&gt;subject, 1-&gt;predicate, 2-&gt;object; 3-&gt;model but that should already have been done).
<br/>
3) Repeat for [[ConstraintNegation]] (and any other constraint type that implements getElement(), but IIRC there aren't any).
<br/>
4) Remove getElement() from the Constraint interface and implementing classes thereby banishing this aberration. 

No data to display

Also available in: Atom PDF