Class Constructor for AD and TEL
xmlcoder
#1 Posted : Thursday, December 15, 2011 6:10:59 PM(UTC)
Rank: Member

Groups: Registered
Joined: 12/7/2011(UTC)
Posts: 18
Points: 54

Thanks: 2 times
Was thanked: 0 time(s) in 0 post(s)
Within both the AD and TEL datatypes the "Use" attribute is defined as a SET<CS>

It would seem sensible to me that the constructor work initialise these collections, but this is left to the user code, is there a reason for this.
If not could this be added to the next release.
justin.fyfe1
#2 Posted : Thursday, December 15, 2011 6:23:40 PM(UTC)

Rank: Administration

Medals: Mobile Tech Grasshopper: Mobile Tech GrasshopperHealth Informatics MVP

Groups: Registered, Administrators
Joined: 7/22/2010(UTC)
Posts: 96
Points: 297
Man
Location: Hamilton, ON

Thanks: 2 times
Was thanked: 17 time(s) in 17 post(s)
The reason that these types of collections are not initialized by the constructor is consistency with the RMIM classes, and validation.

By default any built-in collections (such as System.Collections.List<>) are initialized.

v3 collections and types on the other hand (SET, LIST, BAG, and even II, CS, and others) are not constructed by data types or RMIM classes as they're slightly more complex than simple types (in their use of NullFlavors). If a constructor created an empty SET, and the developer did not add any items nor set a null-flavor, then the SET (and the instance of the class that contains the SET) would be invalid according to v3 validation rules. We felt that it would be more tedious for a developer to explicitly set null flavors on instantiated v3 collections than to just create them when needed.

One possible method we could use for assisting developers is allowing the user to pass a TelecommunicationsAddressUse via a constructor which could instantiate and add the value to the Use property.

Hope that helps clarify this behavior.
xmlcoder
#3 Posted : Monday, December 19, 2011 11:33:31 AM(UTC)
Rank: Member

Groups: Registered
Joined: 12/7/2011(UTC)
Posts: 18
Points: 54

Thanks: 2 times
Was thanked: 0 time(s) in 0 post(s)
OK, that makes sense - thanks for the response.
Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

SoClean Theme By Jaben Cargman (Tiny Gecko)
Powered by YAF 1.9.4 | YAF © 2003-2010, Yet Another Forum.NET
This page was generated in 0.075 seconds.