This sort of cropped up in a conversation today.
Should one, (i.e. is it OO "pure"), to use a parameterized constructor to set up an object with initial values or should one use a contrived method?
I'll explain how this came about. We have a class whose attribute values are, once set, very stable (for that instance). In fact if it were C or C++ I would have used a STRUCT, but for various reasons irrelevant to the question the system uses classes. The class structure represents a (set of) query-by-example constraint(s) for a database persistence driver. It sort of looks like this:
Class QBE+ConstraintList : Collection //of type QBEConstraint
Class QBEConstraint+ColumnName : String
+Comparator : String //restricted values e.g. "=",">","%", etc
+Values :Variant(*)
So each QBEConstraint object represents a set of "OR" values for a particular column and each item in the ConstraintList represents an "AND" condition. Pretty straightforward and conventional.
The conversation arose when one of the cutters wanted to create a constructor override for QBEConstraint to load "simple" instances, the architect disagreed and offered a specific public method to achieve the same thing, viz QBEConstraint.Setup(string,string,variant).
When it was referred to me I had no real opinion

to offer... and when I started to think about it :-/
Hence the question, is it better to....
all correspondence will be gratefully depreciated
bruce
p.s. "Most" instances are "simple"