In this article, the basic concepts of Operations are explained.
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.
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
InvoiceOverviewOp.database, of the interface type IDbDefinition.userKey, of the interface type IExpression, specifically an interface IDbKey of table User.inSelectionMode, of the type BooleanExpression.preSelectInvoiceNumber, of the type IntegerExpression.database is ... ?public IProperty<IDbKey<User>> UserKey => ValueProperty(Database.GetTable<User>().PrimaryKey.Null);userKey is declared to be public ValueProperty, namely a NULL value of the PrimaryKey of the table User from Database.
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