AppFrame Access Layer
AppFrame is the application development framework, upon which PIMS and other applications are developed and implemented.

afAccessLayer (client)
• Entry point for applications using the AppFrame Data Access Layer
• Needs to be initialized using afAccessLayer.Initialize Methods before using data methods.
• Sets proxy settings
• Assigns delegates (afSqlAccessLayer)
• Notifies afSqlAccessLayer if remoting is to be used
• Notifies afSqlAccessLayer of authenticationmode to be used (WinAuth or Sql)
• Runs the stored procedure sstp_System_Authenticate
• Creates the UserSession object (User and Service)
• If used in design mode (Visual Studio), it sets the maxrecords property on all recordsources to 5
afSqlAccessLayer (client)
• If remoting is enabled it will establish a .NET remoting channel to the remoting host. (Proxy objects are created when a client activates a remote object.)• If remoting is not enabled it will use the local afRemotingLoader library
• Deserializes DataTables and DataSets received from the RemotingLoader class using a class called DataSetSurrogate
• DataSetSurrogate class
• Implements binary serialization of a DataSet or DataTable through a Surrogate object
• Another benefit of the surrogate class is that it prevents convertion of datetime columns between timezones.
• When you pass an object of the DataSet class to a remote Web service or to a Web service that is in a time zone that is different from the time zone of the calling application, the DateTime columns in a contained table are converted to the equivalent local time.
afRemotingLoader (client or web server)
• If located on a web server it will read web.config to determine if two layer remoting is enabled. AppSetting: ”InternalRemotingHost”
• If InternalRemotingHost is enabled it will create a new appdomain and use reflection to load afRemoteSqlAccessLayer2 (no reference)
• If located on client or two layer remoting is not enabled it will forward the call to
afRemoteSqlAccessLayer and afRemoteSqlAccessLayer2 (web server)
• Only used by a server in DMZ when two layer remoting is enabled.
• Establishes a .NET remoting channel to the internal remoting host.
• Forwards all calls to afRemoteSqlAccessLayer
• The reason for having this library is that it is not possible to have multiple remoting channels in the same AppDomain
afRemoteSqlAccessLayer (client or web server)
• Located on client
• Caches TableDefinitions used in validation
• Located on web server
• Impersonates the user if integrated security is specified
• Performs validation of the afRecordSource and afProcedureCall object against sviw_System_ValidObjectsWithColumns
• Determines if the databaseobject provided exists in the db
• Determines if all fields and parameters exists in the db
• Performs a validation of
• Master-child criteria
• WhereClause
• FilterString
• Uses transactions for all stored procedure calls
• Wraps the DataTable and DataSet in surrogate classes for binary serialization