Edward,

Still I am working on distributed Ptolemy,

My objective is to distribute the Ptolemy in such a
way that we should be able to use already developed
Ptolemy Actor/Directors with minimal or no change.
Also, we should be able to test localized and
distributed version of a Ptolemy model without
changing its code.

To do this, I think first we should define Java
interface classes for every Ptolemy class because in
distributed environment, remote parties distinguish
objects with their interface type.

As first exercise, I have worked on NamedObj class and
defined its interface. Because this class has been
used every where in Ptolemy, I need to be careful. Our
original NameObj class as renamed as NamedObjImpl and
new class implements new NamedObj interface like the
following.

public class NamedObjImpl implements  NamedObj {
...
} 

public interface NamedObj extends Changeable,
Cloneable, Debuggable,
DebugListener, Derivable, MoMLExportable,
ModelErrorHandler, Moveable,
Serializable
{
        public void attributeChanged(Attribute attribute)
throws IllegalActionException;
        public NamedObj getContainer();
        public List attributeList();    
        public List attributeList(Class filter);
......
}

I have modified all the places due to this change.
Now, I can run models successfully  with this
modification.

Next thing, I will do same thing for other core
Ptolemy classes like Attribute, Director, Actor ,Port,
Relation, Manager etc. But whatever I am doing will
not break any existing Ptolemy functionality.

I don't know how much further I can go.

If we can define all Java interfaces for  all Ptolemy
classes I think we can easily port it to Corba/EJB/Web
Services distributed domain with minimal effort.

I am looking for guidance from you and Ptolemy group,
I appreciate your help,

Erol Akarsu
--- "Edward A. Lee" <[EMAIL PROTECTED]> wrote:

> 
> One key difference is that the workspace associated
> with a
> Ptolemy object is immutable (it cannot be changed
> after the object
> is constructed).  Thus, at a minimum, you should use
> the constructor
> that takes a workspace argument, and specify the
> same workspace
> as the container into which you will put the
> object...
> 
> The workspace is used synchronize interactions with
> the model,
> such as editing via Vergil...
> 
> Edward
> 
> At 12:01 PM 9/23/2005 -0700, Erol Akarsu wrote:
> >Hi:
> >
> >I am working on a Distributed Ptolemy through
> >CORBA/EJB/Web Services,
> >
> >I am learning the Ptolemy code. I like its software
> >architecture, that is good to me.
> >
> >I have a question. When we run a model with
> >PtExecuteApplication provided with XML source of
> >model,  Ptolemy internally calls the constructor
> like
> >this:
> >
> >public CompositeActor/Actor/Director
> (CompositeEntity
> >container, String name)
> >
> >Here I have a question. If I would instantiate the
> >constructor with empty argument like this:
> >
> >  public CompositeActor()
> >
> >and call setContainer and setName on the result
> >object:
> >
> >I mean:
> >
> >Current way:
> >
> >p = new Actor/CompositeActor/Director (container,
> >name)
> >
> >Instead of this, this  will be equal to above
> >semantically:
> >
> >p = new Actor/CompositeActor/Director ();
> >p.setContainer (container)
> >p.setName(name)
> >
> >Thanks
> >
> >Best Regards
> >
> >Erol Akarsu
> >
> >     public CompositeActor(Workspace workspace)
> >
> >
> >
> >     public CompositeActor (CompositeEntity
> container,
> >String name)
> >
> >
> >
> >
> >
> >__________________________________
> >Yahoo! Mail - PC Magazine Editors' Choice 2005
> >http://mail.yahoo.com
> >
>
>----------------------------------------------------------------------------
> >Posted to the ptolemy-hackers mailing list.  Please
> send administrative
> >mail for this list to:
> [EMAIL PROTECTED]
> 
> ------------
> Edward A. Lee
> Professor, Chair of the EE Division, Associate Chair
> of EECS
> 231 Cory Hall, UC Berkeley, Berkeley, CA 94720
> phone: 510-642-0253 or 510-642-0455, fax:
> 510-642-2845
> [EMAIL PROTECTED],
> http://ptolemy.eecs.berkeley.edu/~eal  
> 
> 


        
                
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

----------------------------------------------------------------------------
Posted to the ptolemy-hackers mailing list.  Please send administrative
mail for this list to: [EMAIL PROTECTED]

Reply via email to