[kepler-dev] graph dependency on kernel.util

Christopher Brooks cxh at eecs.berkeley.edu
Sat Jun 7 11:00:35 PDT 2008


Perhaps we should have a ptolemy.kernel.core package which would have
the Nameable interface and the exceptions.  Other possible package
names could be ptolemy.kore, ptolemy.core, ptolemy,nameable.

One issue with ptolemy.util is that it is not currently required
by ptolemy.kernel and ptolemy.kernel.util.  Also, ptolemy.util
really has three groups of classes:

Static utilities that do common things we need in many places:
  ClassUtilities.java
  FileUtilities.java
  StringUtilities.java
  XSLTUtilities.java

Error and warning messages:
  CancelException.java
  MessageHandler.java

Subprocess execution:
  ExecuteCommands.java
  StreamExec.java
  StringBufferExec.java

This points to perhaps further breaking down ptolemy.util into
subpackages.  There are dependencies between these groups though.
For example, StringBufferExec uses StringUtilities.

So, I'm concerned about adding Nameable to ptolemy.util.

However, there is a larger issue: I can rearrange files endlessly, but
is the pain and suffereing worth it?  For example, changing the
exceptions in ptolemy.kernel.util would basically touch every Java
file.  We could leave the old exceptions as deprecated, which
would help solve the graph package issue.

I'd like to see some of these package dependencies fixed, and reorgs
are usually better sooner than later.

_Christopher


--------

    
    One way to fix these dependencies would be to move the
    Nameable interface to util and make the exception package use
    it instead of NamedObj.
    
    Edward
    
    At 04:03 PM 6/6/2008, Christopher Brooks wrote:
    >Currently, the ptolemy.graph depends on kernel.util
    >for the exceptions and it uses NamedObj in one
    >place to for a better error message.
    >
    >This morning, I tried changing ptolemy.graph so that
    >it used ptolemy.graph.GraphActionException and
    >GraphInvalidStateException.
    >
    >Both these exceptions currently extend similar exceptions
    >in kernel.util but I thought that if this worked out, I would
    >consider breaking the dependency.
    >
    >Anyway, it turns out that there are a bunch of methods
    >in Variable, TypedIOPort, type.MonotonicFunction, 
    >actor.lib.RecordUpdater type.FunctionType and many
    >other places where we have inner classes that extend
    >the graph classes like InequalityTerm.  The problem
    >is that these are all declared to throw IllegalActionException.
    >
    >Is it worth making these changes and cleaning up the
    >dependency?  I don't mind doing the work, but it does
    >mean that old code will likely break.
    >
    >_Christopher
    >_______________________________________________
    >Kepler-dev mailing list
    >Kepler-dev at ecoinformatics.org
    >http://mercury.nceas.ucsb.edu/ecoinformatics/mailman/listinfo/kepler-dev
    
    ------------ 
    Edward A. Lee
    Chair of EECS and Robert S. Pepper Distinguished Professor
    231 Cory Hall, UC Berkeley, Berkeley, CA 94720-1770
    phone: 510-642-0253, fax: 510-642-2845
    eal at eecs.Berkeley.EDU, http://www.eecs.berkeley.edu/Faculty/Homepages/lee.h
   tml  
--------


More information about the Kepler-dev mailing list