Creating / Loading objects


BirdDog Software's framework manages the creation of objects for you using the Factory pattern. Top level objects use the main Factory, which can be accessed at AppCon.GetAppCon.Factory, while child objects use their parent object as the Factory.


For example, to create a new top level object (an IOrder in this example):

Dim oOrder As IOrder = AppCon.GetAppCon.Factory.OrderNew

To load an existing top level object:

Dim oOrder As IOrder = AppCon.GetAppCon.Factory.OrderLoaded(OrderTypes.Order, 12345)


To create a new child object, use an Add method on the parent object (an IOrderLine in this example)

Dim oLine as IOrderLine = oOrder.AddLine("ABC123")

To load an existing child object, use the collection on the parent object:

Dim oLine as IOrderLine = oOrder.Lines(0)