L
larzeb
One of my classes generates an array of a custom objects. That array
is passed to a validation class, which sets each member of the array's
isValid property to true or false.
The array is then passed to two more classes for further processing in
a read-only manner.
As I see it, I can pass the array to each of the two classes and let
each of them inspect the isValid property, processing only those those
objects which are true.
Or, after the array is validated, I could create an arraylist and
populate it with only those objects which have the isValid property
set to true, passing the arraylist to the remaining two processes.
Any ideas on which approach might be better? I'm not clear about
encapsulation versus the increased execution time.
TIA
is passed to a validation class, which sets each member of the array's
isValid property to true or false.
The array is then passed to two more classes for further processing in
a read-only manner.
As I see it, I can pass the array to each of the two classes and let
each of them inspect the isValid property, processing only those those
objects which are true.
Or, after the array is validated, I could create an arraylist and
populate it with only those objects which have the isValid property
set to true, passing the arraylist to the remaining two processes.
Any ideas on which approach might be better? I'm not clear about
encapsulation versus the increased execution time.
TIA