The idea of the package

A Package is the default datatype to push/pull data in your favorite plugins. These can be the settings, which define the behavior of the plugin (input package) or the results of the plugin execute process (output package).

Every plugin works with the following three package-types:
  • input (every plugin has at least one input package)
  • output (optional)
  • logging (managed from MyCleverFriend code)

If you are familiar with programming languages like C++, Java, C# ... etc, you should sympathize with the syntax of the following code:

public int Add(int a, double b)
{
    return a + b;
}
The given method holds the name "Add" and:
  • has input parameters from type int (a) and type double (b)
  • has one output parameter from type int
  • is defined by the command (return a + b) between the curly brackets

In the philosophy of MyCleverFriend all plugin parameters have only one data type, which we call a package.

public Package Add(Package a, Package b)
{
    ...
}

A package is a complex data type, which inherits all the functionality from the .Net DataTable-Class (System.Data)
This approach has a lot of key benefits, which can help us creating fast and powerful plugin code.

In common programming code an input/output parameter contains usually one dataset. This can be for example one integer, one string or one double. So if we like to process many digital data-sets, we call the "Add"-method for every data-set again and again.
for (int i = 0; i < 100; i++)
{
    // start the "Add" method with new input-parameters again and again
    int ergebnis = Add(i, i*2);
}

In contrast a package contains as much data-sets you need. It looks more like a table, which consist of different columns and rows.

An example for a package, which contains your favorite website-addresses, could look like:
URL -> typeof(string) -> Validation="isURL"
http://www.google.com
http://www.bing.com
http://www.codeplex.com
http://www.sourceforge.com


Another (more advanced) package, which defines your favorite ftp-settings, could look like this
Host -> typeof(string) -> Validation="isURL" FTPFilePath -> typeof(string) UserName -> typeof(string) Password -> typeof(string)
ftp://127.0.0.1 /nextBigThink/ myUserName myPassword
ftp://www.mondayisnotfriday.com /smallWiki/ Don't worry be happy

Last edited Jul 15, 2010 at 8:50 AM by daudiihhdau, version 31

Comments

No comments yet.