SSDM - Sibilo Software Development Model

Search 
(by Google)
     

Developer's Corner - Common Methods
  1. Introduction
    1. Overview (N-tier Architecture)
    2. Downloads
  2. Requirements Capture
    1. Natural Language Text to UML
  3. UML Static Data Model
    1. Object / Class
    2. Relationships
    3. Data Type / Enumeration
    4. Supported Data Types
  4. Application Design
    1. Database (UML-DB Mapping)
    2. Business Objects (UML-Class Mapping)
    3. User Interface (UML-User Control Mapping)
  5. Sibilo Software Development Environment (Sibilo.SDE)
    1. Sibilo.SDE User Guide
  6. Sibilo.DBL Programming
    1. Introduction
      1. Background Information
      2. The Clist Class
    2. Core Objects
      1. Common Constructors
      2. Common Destructors
      3. Common Properties
      4. Common Methods
        • Add
        • Update
        • Remove
        • GetDetails
        • Load
        • Equals
      5. Shared Methods
        • GetAll
        • Remove
        • RemoveAll
        • Exists
        • Search
        • ObjectCount
        • CreateInstance
      6. User Defined Attributes
        • AddAttribute
        • RemoveAttribute
        • GetAttributeList
        • GetClassList
        • GetAttribute
        • SetAttribute
    3. Relationships
      1. Overview
      2. One-to-One Relationships
      3. One-to-Many and Many-to-Many Relationships
        • Add
        • Remove
        • RemoveAll
        • Exists
      4. Default Object of a Relationship
        • SetDefault
        • GetDefault

6.2.4 Common Methods

Almost all SSDM classes have the same basic methods and the ways they interact with each other are predefined. This makes learning to program with SSDM very easy and fast.

Was.Net objects have the following methods:
Add
Update
Remove
GetDetails
Load
Equals

We will now go over how each of these methods can be used for the class CUser.

Function Add() As Integer

Adds the object to the database and returns its ID. If the record cannot be added, returns 0.

Example:

Dim oUser As New CUser()
With oUser
    .FirstName = "John"
    .LastName = "Smith"
End With
Response.Write(oUser.Add())

Function Update() As Boolean

Saves the properties of the current object and returns True if the update is successful. Note that the object must be loaded first, i.e. have an ID, in order to be updated.

Example:

Dim oUser As New CUser(103)
With oUser
    .FirstName = "Johnathan"
    .LastName = "Smith"
End With
Response.Write(oUser.Update())

Function Remove() As Boolean

Deletes the loaded object and returns True if successful or if the object does not exist. Note that the object must be loaded first, i.e. have an ID, in order to be removed.

Example:

Dim oUser As New CUser(103)
Response.Write(oUser.Remove())

Sub GetDetails(Optional ByVal ID As Integer = 0, _
               Optional ByVal RelationsToLoad As CList = Nothing )

Loads an object with the given ID.

If a Clist is provided with the names of the relationships whose data need to be loaded these are loaded as well, in contrast with the usual situation where remote object data are loaded from the database only when they are used.

Example:

Dim oUser As New CUser()
oUser.GetDetails(103)
Response.Write(oUser.FirstName)