cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Announcements
Walkthrough Wednesdays
287
Views
0
Helpful
1
Replies
joshorva
Cisco Employee

FieldSet construction (opinion only)

Currently, the Context Service API allows for the creation of a FieldSet specifying the name of the FieldSet and a Set of the names of the Fields to include as the actual FieldSet.

The remainder of this discussion is just my opinion. Note that the FieldSet constructor currently works very well. One could easily argue that no change or enhancement is needed to the FieldSet constructor.

It seems a bit odd that the FieldSet constructor would require a Set of Strings that are the Field identifiers. I do not have any access to the code, however, I've got to believe that the code for construction of a FieldSet attempts to locate the Fields for the FieldSet based on the Set of Strings passed in. This strategy allows for failure as a String gets included into the Set that actually does not map to a Field (maybe due to a typo).

It seems more natural that the Set passed to the FieldSet constructor be a Set of Fields rather than a set of Strings. Also, it offers more value add since I could have multiple Fields with the same ID that get applied to different FieldSets. This allows for Fields with the same ID that have different properties (such as ENCRYPTED, PII, or UNENCRYPTED).

Therefore, I suggest that the following FieldSet constructors be removed:

FieldSet (Set < String > fields, Boolean publiclyAccessible)

Constructor for FieldSet

FieldSet (String identifier, Set < String > fields, Boolean publiclyAccessible)

Constructor for FieldSet

And, I suggest that the following FieldSet constructors be added:

FieldSet (Set < Field > fields, Boolean publiclyAccessible)

Constructor for FieldSet

FieldSet (String identifier, Set < Field > fields, Boolean publiclyAccessible)

Constructor for FieldSet

1 REPLY 1
ccosenti
Beginner

Thanks Joseph,  I'll pass this along to the Context Service architect.

Content for Community-Ad

This widget could not be displayed.