Concepts
This page explains a few basic concepts behind the Uncle Unc framework.
Items and Views
An Item is the basic unit of the Uncle Unc framework. Think of an Item as representing any resource or a part of a resource that you can interact with. For example, an Item might represent:
- a file in the filesystem
- an entry in a zipfile archive
- an entry in a log file
- a live java object in the running Java Virtual Machine
- a mail or IM message
- a table in a database, or a row in a table
- a node in a network
- an entry in a property or configuration file
A View is simply an Item that contains other Items. At present, the View is a subclass of Item, but with the current refactoring work, the View class will probably be absorbed into Item in the near future.
Binding
An Item may act as a wrapper around any arbitrary java Object, in which case it said to be 'bound' to that object, or 'referencing' the object. This allows a set of Items to accurately reflect an underlying service such as a database server or a filesystem. Items do not need to be bound to a service, but it is currently the most common use for them.
Hierarchy
Items are connected together in a tree-like hierarchy. Each Item has exactly one parent. An item may have any number of children (including none). An Item containing child Items is sometimes referred to as a View.
Properties and Methods
Items may have Properties (a static bit of data, such as a piece of text, a number, or any object), and/or Methods, which will execute some code when invoked. A method may contain parameters. Typically, the method code associated with an Item will affect that Item, or its immediate environment (e.g. siblings, parent View), or operate on the underlying Object bound to the Item.
The Scrap Book
The scrapbook is a special Item used to contain temporary bits of information. It is similar in some ways to a system clipboard, being used to hold objects returned from method invocations, for example, that have no other place to go. The scrapbook can also be populated programmatically - the Sirius GUI app allows user-defined jython scripts to populate the scrapbook in an easy and flexible way. Contents of the scrapbook may be filtered when picking method parameters.
Navigation
The tree structure in which Items are arranged lends itself well to navigational metaphors developed by file browsers. Uncle Unc supplies generic navigation components that can maintain history lists, lists of parent views, etc., which can be hooked into command-line, gui or other user interfaces. The Sirius GUI Nav Bar uses these generic components to provide a set of browser-like controls.
Paging
A View bound to a large datastore may containmany children, more than is comfortable to display at one time. Paging is used to describe thew process of breaking such a view into smaller regular-sized chunks, and providing a navigational means for moving between the pages. The Sirius GUI Pager Widgets use generic UI-independent components to provide a web-search-engine-look-a-like toolbar that can be useful when examining large logfiles or databases, for example.
The paging functionality is provided as an abstract interface, with a simple default implementatiion that holds all children in memory and simply filters out a selected subset based on page cursor position and page length. For some bound services, such as databases, a more efficient native implementation can be substituted. Similarly, there are pager implementations designed specifically for Views containing an unknown number of children, which can be 'read' from the native service on demand. This provides an efficient mechanism, for example, when reading a log file holding thousands of entries, allowing the file to be 'wrapped' into Items incrementally, rather than all at once.
Filters
Filters are generic objects that can be used to hide or show only certain children in a View. Standard sets of filters are provided that can discriminate on Item name, property, or other attributes. There are filters that can understand regular expressions, allowing powerful flexible capabilities, and filters that can match java objects by superclass and interface. Filters may act as whitelists or blacklists. Filters can be nested within one another to execute complex logic, such as 'show all children referencing a foo.bar object with property baz matching the globbing expression *.unc if such a property is present'. Filters themselves implement some of the functonality of Items (they can be containers, and may exhibit properties), and it is intended to be able to expose filter manipulation to Uncle Unc-based user interfaces in the future.

