Skip to content

SAIF.Presentation.Web.Binding.Infragistics103 architecture

SAIF.Presentation.Web.Binding.Infragistics103 is a pure presentation-tier UI-binding library ("ObjectBinder") that connects SAIF business objects to ASP.NET WebForms controls, including both classic (v10.3 "NetAdvantage classic") and modern Infragistics control families. It performs no database access and enforces no business rules of its own; it delegates validation to the bound business object's IDataErrorInfo/IsValid implementation and surfaces the result as control-level formatting and aggregated error messages.

Responsibilities

  • Register and coordinate per-control data bindings between ASP.NET/Infragistics WebForms controls and SAIF business-object properties, via clsObjectBindManager acting as a page-level System.Web.UI.Control facade/mediator.
  • Push business-object property values into bound controls (object → control) and pull control values back into business-object properties (control → object), using reflection-based property get/set defined in the shared base class clsObjectBinderBase.
  • Aggregate and surface validation errors from bound business objects (via IDataErrorInfo/IsValid) as CSS error/valid formatting on controls and as consolidated error text (optional ErrorLabel/SAIFMessage display).
  • Support supplemental validation scenarios that are not simple property-to-control bindings: custom validators (clsCustomValidator, property/method/object modes) and dual binders where the displayed value and the validated value come from different object/property pairs (AddDualBinder).
  • Provide typed argument bags (clsObjectBindingArgs and its nested argument classes) that carry control-family-specific binding options (padding, grid keys, mask/numeric/date-editor options) into the Add() overload family.

Component boundaries

  • clsObjectBindManager (root orchestrator): owns the ArrayList of active binder instances (m_Bindings), exposes the ~90 overloaded Add() methods (one family per control type), DataBind(), BindToObject(), Validate(), RefreshValidation(), AddCustomValidator(), AddDualBinder(), and grid/DDL Update() helpers. It is the only type a consuming ASPX page interacts with directly.
  • clsObjectBinderBase (shared binder contract/services): MustInherit root of the binder hierarchy defining the abstract contract (Init(), ObjectToControl(), ControlToObject()) every concrete binder implements, plus shared reflection-based property access, error-state CSS formatting (SetControlFormat), IDataErrorInfo error harvesting (GetErrors), and SAIF-framework-object detection (IsSAIFFrameWorkObject).
  • clsObjectBindingArgs (argument surface): strongly-typed argument bag and nested/related argument classes (CheckBoxBindingArgs, PadArgs, HierarchialGridArgs, UltraGridBindingArgs, WebDataGridBindingArgs, WebHierarchicalDataGridBindingArgs, SAIFMaskEditBindingArgs/WebMaskEditBindingArgs, WebDateTimeEditBindingArgs, WebNumericEditBindingArgs) that parameterize Add() overloads.
  • clsCustomValidator: a non-control-bound validator supporting Property/Method/Object validation modes via delegate properties, registered through the same AddBinder() path as control binders.
  • ASPControls\ (stock ASP.NET WebControls binder family): clsCheckBoxBinder, clsCheckBoxListBinder, clsDataListBinder, clsDDLBinder, clsHyperLinkBinder, clsLabelBinder, clsRadioButtonBinder, clsTextBoxBinder — each adapts a standard System.Web.UI.WebControls type to the clsObjectBinderBase contract.
  • InfragisticsControls\ (modern Infragistics Infragistics.Web.UI family): clsSAIFWebMaskEditorBinder, clsWebDataGridBinder, clsWebDatePickerBinder, clsWebDateTimeEditorBinder, clsWebHierarchicalDataGridBinder, clsWebMaskEditorBinder, clsWebNumericEditorBinder, clsWebTextEditorBinder.
  • InfragisticsClassicControls\ (classic "10.3 NetAdvantage" family): clsSAIFWebMaskEditBinder, clsUltraGridBinder, clsWebComboBinder, clsWebDateChooserBinder, clsWebDateTimeEditBinder, clsWebHtmlEditorBinder, clsWebMaskEditBinder, clsWebNumericEditBinder, clsWebTextEditBinder.
  • Enums.vb (shared vocabulary): public enums/delegates (ObjectDataType, PadDirection, PadTarget, ControlBindProperty, NumericControlProperty, CustomValidationType, BindTypes, CustomBindingControls, and the PropertyValidator/MethodValidator/CustomValidator delegates) used across all binder families.
  • Root-level orphaned duplicates: a parallel set of root-level .vb files with the same class names as the ASPControls\/InfragisticsControls\/InfragisticsClassicControls\ binders exist on disk but are excluded from the .vbproj Compile Include list; they are stale, unbuilt copies* and are not part of the compiled component boundary, even though the .nuspec packages them as source (see Dependencies).

Interaction model

  • A consuming ASPX page instantiates clsObjectBindManager as a server control and calls one of the Add() overloads per control/business-object property to register a binding; each call constructs the matching concrete binder, sets FormControl (triggering ProcessControl), sets BindType/UseEvents, calls Init() (wiring native control change events when UseEvents is true), and registers the binder via the private AddBinder() helper, which also keys the bound object into m_ValidationObjects (a HybridDictionary) using ValidationKey.
  • DataBind() (an override of Control.DataBind, also invoked automatically from OnPreRender when AutoBind = True) iterates all registered binders and calls ObjectToControl() on any binder whose BindType is ObjectToControl or TwoWay, pushing business-object property values into controls.
  • BindToObject() iterates binders whose controls are not event-driven (or all binders, if inAllControls:=True) and calls ControlToObject() for ControlToObject/TwoWay binders, pulling control values back into business-object properties with binder-specific type coercion (e.g., clsDDLBinder.ControlToObject switches on ObjectDataType).
  • Validate()/RefreshValidation() first call BindToObject() to sync non-event-driven controls, optionally re-check IsValid on distinct bound objects, then iterate binders calling PerformValidation() (custom validators) or GetErrors() (standard binders reading IDataErrorInfo.Item(property)), aggregating unique error messages, tracking the first control in error, applying CSS formatting via SetControlFormat, and writing consolidated error text to an optional ErrorLabel and/or SAIFMessage control.
  • AddDualBinder() supports binding a control's displayed value to one object/property while validating against a different object/property pair, for a fixed set of control kinds (CustomBindingControls).
  • Update(UltraWebGrid|WebDataGrid|DropDownList, dataSource) locates an existing matching binder by control UniqueID, updates its BindSource, and re-invokes ObjectToControl() to refresh the control after the underlying collection changes; this re-registers the binder via AddBinder(), which appends rather than replaces the entry in m_Bindings*.
  • The library's only coupling to SAIF.BOF.Framework is reflection/string-based: IsSAIFFrameWorkObject walks the CLR base-type chain for the literal names "clsBusinessCollectionBase"/"clsBusinessBase", and the validation key is derived from the object's MyGuid property (via reflection) when recognized, or the uppercased type name otherwise.

Architecture diagram

The following diagram shows the high-level component interactions between a consuming page, the binder manager, concrete binders, and bound business objects.

flowchart TD
    Page["Consuming ASPX page"] --> Manager["clsObjectBindManager<br>(facade/mediator)"]
    Manager --> Base["clsObjectBinderBase<br>(shared binder contract)"]
    Base --> ASP["ASPControls binders<br>(TextBox, DDL, CheckBox, CheckBoxList, DataList, HyperLink, Label, RadioButton)"]
    Base --> Modern["InfragisticsControls binders<br>(WebDataGrid, WebDatePicker, WebDateTimeEditor, WebMaskEditor, WebNumericEditor, WebTextEditor, WebHierarchicalDataGrid)"]
    Base --> Classic["InfragisticsClassicControls binders<br>(UltraWebGrid, WebCombo, WebDateChooser, WebDateTimeEdit, WebHtmlEditor, WebMaskEdit, WebNumericEdit, WebTextEdit)"]
    Base --> Validator["clsCustomValidator"]
    Manager --> BizObj["SAIF business object<br>(clsBusinessBase / clsBusinessCollectionBase)*"]
    Base --> BizObj
    Manager --> ErrorUI["ErrorLabel / SAIFMessage control*"]

Sequence diagram

The following diagram shows the primary object-to-control data push and validation sequence.

sequenceDiagram
    participant Page as ASPX page
    participant Manager as clsObjectBindManager
    participant Binder as Concrete binder
    participant Obj as SAIF business object
    Page->>Manager: Add(control, object, keyProperty, [args], bindType)
    Manager->>Binder: New binder, Init(), AddBinder()
    Page->>Manager: DataBind()
    Manager->>Binder: ObjectToControl()
    Binder->>Obj: GetObjectValue(AsString)
    Obj-->>Binder: property value
    Binder-->>Manager: control updated
    Page->>Manager: Validate()
    Manager->>Binder: BindToObject(), GetErrors()
    Binder->>Obj: IDataErrorInfo.Item(property)
    Obj-->>Binder: error text
    Binder-->>Manager: aggregated errors, CSS formatting
    Manager-->>Page: IsValid / error state

Design constraints

  • No database access and no independent business-rule evaluation: all rule outcomes originate in bound SAIF.BOF.Framework business objects and are only surfaced, not computed, here.
  • Two Infragistics control-library generations must be supported side by side (InfragisticsClassicControls\ for v10.3 "classic" controls vs. InfragisticsControls\ for the modern Infragistics.Web.UI family), doubling the binder surface for grid/editor control types.
  • SAIF-framework-object detection is a string/reflection-based check on the CLR base-type chain ("clsBusinessCollectionBase"/"clsBusinessBase") rather than a compiled type reference, coupling correctness to type-name stability in SAIF.BOF.Framework.
  • The .vbproj Compile Include list is the authoritative definition of the built surface; a full parallel set of root-level duplicate binder .vb files exists on disk but is excluded from compilation, is textually different (7–10 lines) from the built subfolder versions, and is nonetheless packaged as source into the NuGet package by the repository's .nuspec recursive glob — a known discrepancy between packaged source and built binary content*.
  • Resolution of the modern Infragistics.Web.UI.GridControls/Infragistics.Web.UI.EditorControls namespaces at build time is not confirmed from this library's own project references and is presumed to occur transitively through the SAIF.Presentation.Web.Controls.V2 project reference.**
  • Update()'s append-rather-than-replace behavior in m_Bindings when re-registering a binder for a changed data source may produce duplicate binder entries; this appears to be an unverified latent behavior rather than a confirmed intentional design choice.*

Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.

Sources

  • SAIF.Presentation.Web.Binding.Infragistics103\SAIF.Presentation.Web.Binding.Infragistics103.vbproj
  • SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindManager.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBinderbase.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\clsObjectBindingArgs.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\clsCustomValidator.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\Enums.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\ASPControls\clsTextBoxBinder.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\ASPControls\clsDDLBinder.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\ASPControls\clsCheckBoxListBinder.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\InfragisticsClassicControls\clsUltraGridBinder.vb
  • SAIF.Presentation.Web.Binding.Infragistics103\InfragisticsClassicControls\clsSAIFWebMaskEditBinder.vb
  • SAIF.BOF.Presentation.Web.Infragistics103.nuspec