Creating new Class Library Packages/en
Inhaltsverzeichnis
- 1 Introduction
- 2 Classes, Namespaces, Packages and Class Libraries
- 3 Development
- 4 Deployment
- 5 Dynamic Loading during the Testrun (explicit loading)
- 6 Automatic Loading when a Suite is Loaded
- 7 Preloading at expecco Startup (via Command Line)
- 8 Preloading at expecco Startup (by Changing the Startup Script)
- 9 Tutorial Example: An additional Math Function
- 10 Tutorial Example: A Simple Protocol Implementation
- 11 Tutorial Example: A Device Interface
- 12 Tutorial Example: An expecco Extension Plugin
Introduction[Bearbeiten]
Expecco is a platform that can be extended. Similar to plugins and extensions as provided by eXept, end-users can write add-on packages to extend the functionality and/or the user interface. Expecco already includes a full development system for such extensions.
Classes, Namespaces, Packages and Class Libraries[Bearbeiten]
Expecco's underlying runtime system is a Smalltalk/X system (ST/X) consisting of a virtual machine and a number of classes which are organized into class libraries. Class libraries can be loaded either at startup time, or dynamically (explicit) at runtime. Class libraries may be deployed in source form or as precompiled binaries.
Classes are organized into so called packages which are loaded together. In addition to additional classes, packages may also contain so called extension methods, which may add or replace individual methods to classes in other packages.
In addition to the package organization, classes may also be placed into their own namespace. Packages and namespaces are two different attributes of a class (in contrast to e.g. Java or C#, where the package attribute is also used as the namespace prefix). This makes it possible in ST/X, to generate packages which add or modify functionality to other packages, down to the granularity of a single method.
Development[Bearbeiten]
For the development of extensions, the builtin class browser (usually called "System Browser") is used, which is documented in the ST/X online documentation. The browser is opened via "Extras" → "Tools" → "Class Browser".
Plugin API[Bearbeiten]
Details are presented in a video presentation (Webinar) upon request.
Deployment[Bearbeiten]
Details are presented in a video presentation (Webinar) upon request.
Dynamic Loading during the Testrun (explicit loading)[Bearbeiten]
In an elementary action block, use one of the following code fragments:
Smalltalk loadPackage:
nameOfPackage
loads a package by package-name. The package must be found as package folder under the expecco "packages" folder, or as a compiled class library in the expecco binary folder.
Smalltalk fileIn:
nameOfSourceFile
loads a single class file by file-name. The file can contain the source code of a package, single class, extension method(s) or a script to be executed. Typically, such files are generated via the class browser's "File Out" menu function.
as an alternative, use one of the utility actions found in the "Reflection Library":
Load Package
takes the name of a package (given as a package identifier, such as "exept:expecco/plugin/selenium") and tries to load it. This is a wrapper block on the above "loadPackage" call.
Load File
takes a pathname and tries to load it. This is a wrapper block on the above "fileIn" call.
Automatic Loading when a Suite is Loaded[Bearbeiten]
Add the package name to the suite's prerequisite package list. (in the tree, select the suite; in the editor, select the "Misc" tab. Find the "Prerequisites" section there.
The package must be found in the expecco installation folder under the "packages" folder.
Preloading at expecco Startup (via Command Line)[Bearbeiten]
Start expecco with a "--loadPackage
" argument.
Preloading at expecco Startup (by Changing the Startup Script)[Bearbeiten]
Edit the expecco startup script found in the bin-folder of the expecco installation folder. There, add a section like:
Smalltalk loadPackage:'<your package name>'
or:
Smalltalk fileIn:'path-to-binary-or-source'
Tutorial Example: An additional Math Function[Bearbeiten]
Presented in a video presentation (Webinar) upon request.
Tutorial Example: A Simple Protocol Implementation[Bearbeiten]
Presented in a video presentation (Webinar) upon request.
Tutorial Example: A Device Interface[Bearbeiten]
Presented in a video presentation (Webinar) upon request.
Tutorial Example: An expecco Extension Plugin[Bearbeiten]
Presented in a video presentation (Webinar) upon request.