Operations


Basic concepts of Operations

Table of Contents

In this article, the basic concepts of Operations are explained.

Operations work

In terms of the MVC concept, the Operations could be called the Controllers. The Forms would be the Views and the Database would be the Model.

An operation does "the work". The operation can read information from the database and present that by passing information to one or more forms. Forms are external classes that are connected to the operation. In some cases the form is incorporated inside the class of the operation itself.

See for more information about the connection between forms and operations: Forms 

In AI-Framework, operations are used for the standard functions, but also to build a base which other inherit from, and an operation that inherits from an interface (See ... ).

Below you find examples of these options.

Code examples

Example 1: The average operation

public InvoiceOverviewOp(IDbDefinition database, IExpression<IDbKey<User>> userKey)
   : base(database)
{
   RegisterInputParameter(UserKey, userKey);
}

protected override IForm CreateStartupForm()
{
   return new InvoiceOverviewFrm(this);
}

public IProperty<IDbKey<User>> UserKey => ValueProperty(Database.GetTable<User>().PrimaryKey.Null);

Explanation of the code

 

See also Forms 

See also the Tutorial: Setting up an operation and a form  



Article ID: 166
Created: Tue, Aug 27, 2019
Last Updated: Fri, Jan 10, 2020

Online URL: https://wiki-ai-framework.abstract-it.nl/article/operations-166.html