hubuse

- NAME
- SYNOPSIS
- DESCRIPTION

- Module Directory Structure

- AUTHOR
- COPYRIGHT
- UPDATED

# NAME

hubuse - Using the Hub library

Top

# SYNOPSIS

The Hub module represents functions and classes which are implemented in descendant packages. Hub dynamically loads modules according to the parameters it is used with.

Top

# DESCRIPTION

Don't use the underlying modules directly:

      use Hub::Base::Logger;        # Wrong
      use Hub;                      # Correct

      my $logger = Hub::Base::Logger->new( 'my.log' );    # Wrong
      my $logger = Hub::mkinst( 'Logger', 'my.log' );     # Correct

Without getting into gory detail, this non-standard approach is in place for two reasons:

      1) Allow the library to be refactored (maintained) without impacting existing
         code.

      2) We don't want to short-circut Perl's built-in require functionality which
         would be necessary.

## Module Directory Structure

By default, Hub tries to be as efficient as possible, only loading packages which are necessary. Descendant packages are BulkSplit so that when it is required, only the header (dependancies and export lists) are loaded, and the body is AutoLoaded on the first call to a subroutine. See the hubsplit manpage for details.

Subdirectories are used to group exported modules. Underneath the root (Hub) directory, are sub-directories which represent the export tag of which the underlying modules should be represented.

        Hub/:
          |-Base/:
          |-Util/:
          `-Webapp/:

Descendant packages maintain their exported symbols in the EXPORT_OK array. The Hub module proxies these exported symbols, thus requiring all descendant- exported symbols to be unique.

Classes are created with the Hub::mkinst using their short-name. Thus requiring them to be unique (to other classes):

      1. Hub::Custom::Class.pm       # defines function 'new'
      2. Hub::Another::Class.pm      # doesn't define 'new'
      3. Hub::Yetagain::Class.pm     # also defines 'new'

#1 and #3 will clash because they are both classes, but either can be used with #2 simultaneously.

Top

# AUTHOR

Ryan Gies

Top

# COPYRIGHT

Copyright (c) 2006 Livesite Networks, LLC. All rights reserved.

Copyright (c) 2000-2005 Ryan Gies. All rights reserved.

Top

# UPDATED

This file created by <#sys/proc/zname> on <#dt(nozeros,notime);sys/proc/tstamp> at <#dt(ampm,nosec,nozeros,nodate);sys/proc/tstamp>

Top