i am working on a program with a framework, and modules that will plug into it, and i need to know how to send a class name around. for example: i have a method in one class, that servers as a module, that will "Procces Commands" sent to the framework. I have another class that is suposed to manage the commands and getting them to the right place.
ManCommands-the command managing class
Framework-the framework that manages input/output
BasicModule1-a module that will eventually be used to run other "modules"
how do i get the framework to tell ManCommands to send the command sent to the framework to the ProccessCommand method it BasicModule1>
Hi David.
I'm not sure I understand your question. However, if your commands are Smalltalk selectors (method names), then you can send the message perform: using the command you want to execute as the argument. For instance,
ManCommands perform: command
/Leandro
_____
From: squeak-dev-bounces@lists.squeakfoundation.org [mailto:squeak-dev-bounces@lists.squeakfoundation.org] On Behalf Of David Zmick Sent: Wednesday, January 02, 2008 4:40 PM To: squeak-dev@lists.squeakfoundation.org Subject: my Framework
i am working on a program with a framework, and modules that will plug into it, and i need to know how to send a class name around. for example: i have a method in one class, that servers as a module, that will "Procces Commands" sent to the framework. I have another class that is suposed to manage the commands and getting them to the right place.
ManCommands-the command managing class
Framework-the framework that manages input/output
BasicModule1-a module that will eventually be used to run other "modules"
how do i get the framework to tell ManCommands to send the command sent to the framework to the ProccessCommand method it BasicModule1>
they aren't smalltalk related. I'm trying to develop a framework to develop cryptology programs on, and the framework needs to have and input and an output. I can't figure out how to pass a class name to different selectors. i need the framework to be able to load different modules, so i need to have some sort of variable called activeModule that will store the class name to pass things to. I need to be able to say something like
activeModule ManCommand: command.
thanks, dzmick
On 1/2/08, Leandro Caniglia caniglia@dm.uba.ar wrote:
Hi David.
I'm not sure I understand your question. However, if your commands are Smalltalk selectors (method names), then you can send the message perform: using the command you want to execute as the argument. For instance,
ManCommands perform: command
/Leandro
*From:* squeak-dev-bounces@lists.squeakfoundation.org [mailto: squeak-dev-bounces@lists.squeakfoundation.org] *On Behalf Of *David Zmick *Sent:* Wednesday, January 02, 2008 4:40 PM *To:* squeak-dev@lists.squeakfoundation.org *Subject:* my Framework
i am working on a program with a framework, and modules that will plug into it, and i need to know how to send a class name around. for example: i have a method in one class, that servers as a module, that will "Procces Commands" sent to the framework. I have another class that is suposed to manage the commands and getting them to the right place.
ManCommands-the command managing class
Framework-the framework that manages input/output
BasicModule1-a module that will eventually be used to run other "modules"
how do i get the framework to tell ManCommands to send the command sent to the framework to the ProccessCommand method it BasicModule1>
each module will have a method called ManCommand: aString to tell the framework how to manage commands when that module is loaded
On 1/2/08, David Zmick dz0004455@gmail.com wrote:
they aren't smalltalk related. I'm trying to develop a framework to develop cryptology programs on, and the framework needs to have and input and an output. I can't figure out how to pass a class name to different selectors. i need the framework to be able to load different modules, so i need to have some sort of variable called activeModule that will store the class name to pass things to. I need to be able to say something like
activeModule ManCommand: command.
thanks, dzmick
On 1/2/08, Leandro Caniglia caniglia@dm.uba.ar wrote:
Hi David.
I'm not sure I understand your question. However, if your commands are Smalltalk selectors (method names), then you can send the message perform: using the command you want to execute as the argument. For instance,
ManCommands perform: command
/Leandro
*From:* squeak-dev-bounces@lists.squeakfoundation.org [mailto:squeak-dev-bounces@lists.squeakfoundation.org ] *On Behalf Of *David Zmick *Sent:* Wednesday, January 02, 2008 4:40 PM *To:* squeak-dev@lists.squeakfoundation.org *Subject: *my Framework
i am working on a program with a framework, and modules that will plug into it, and i need to know how to send a class name around. for example: i have a method in one class, that servers as a module, that will "Procces Commands" sent to the framework. I have another class that is suposed to manage the commands and getting them to the right place.
ManCommands-the command managing class
Framework-the framework that manages input/output
BasicModule1-a module that will eventually be used to run other "modules"
how do i get the framework to tell ManCommands to send the command sent to the framework to the ProccessCommand method it BasicModule1>
On Jan 2, 2008 1:39 PM, David Zmick dz0004455@gmail.com wrote:
i am working on a program with a framework, and modules that will plug into it, and i need to know how to send a class name around. for example: i have a method in one class, that servers as a module, that will "Procces Commands" sent to the framework. I have another class that is suposed to manage the commands and getting them to the right place.
ManCommands-the command managing class
Framework-the framework that manages input/output
BasicModule1-a module that will eventually be used to run other "modules"
how do i get the framework to tell ManCommands to send the command sent to the framework to the ProccessCommand method it BasicModule1>
I've taught Smalltalk to a lot of people. Based on that experience, I think you are heading in the wrong direction. You probably shouldn't be talking about modules, but about classes. You shouldn't think about a module that runs other modules. Further, classes are objects, so you usually don't pass names of classes around, but the classes themselves.
Is this your first Smalltalk system?
-Ralph Johnson
yes, it is my first, but i understand all of the classes, etc. I want to make an expandable cryptology system that will have other classes with certain methods to control the framework, or base class, its just fancy words
On 1/2/08, Ralph Johnson johnson@cs.uiuc.edu wrote:
On Jan 2, 2008 1:39 PM, David Zmick dz0004455@gmail.com wrote:
i am working on a program with a framework, and modules that will plug
into
it, and i need to know how to send a class name around. for example: i
have
a method in one class, that servers as a module, that will "Procces Commands" sent to the framework. I have another class that is suposed to manage the commands and getting them to the right place.
ManCommands-the command managing class
Framework-the framework that manages input/output
BasicModule1-a module that will eventually be used to run other
"modules"
how do i get the framework to tell ManCommands to send the command sent
to
the framework to the ProccessCommand method it BasicModule1>
I've taught Smalltalk to a lot of people. Based on that experience, I think you are heading in the wrong direction. You probably shouldn't be talking about modules, but about classes. You shouldn't think about a module that runs other modules. Further, classes are objects, so you usually don't pass names of classes around, but the classes themselves.
Is this your first Smalltalk system?
-Ralph Johnson
OK. Then just show us some of your source code so we can figure out what you are trying to do.
/Leandro
_____
From: squeak-dev-bounces@lists.squeakfoundation.org [mailto:squeak-dev-bounces@lists.squeakfoundation.org] On Behalf Of David Zmick Sent: Wednesday, January 02, 2008 8:00 PM To: The general-purpose Squeak developers list Subject: Re: my Framework
yes, it is my first, but i understand all of the classes, etc. I want to make an expandable cryptology system that will have other classes with certain methods to control the framework, or base class, its just fancy words
On 1/2/08, Ralph Johnson johnson@cs.uiuc.edu wrote:
On Jan 2, 2008 1:39 PM, David Zmick dz0004455@gmail.com wrote:
i am working on a program with a framework, and modules that will plug
into
it, and i need to know how to send a class name around. for example: i
have
a method in one class, that servers as a module, that will "Procces Commands" sent to the framework. I have another class that is suposed to manage the commands and getting them to the right place.
ManCommands-the command managing class
Framework-the framework that manages input/output
BasicModule1-a module that will eventually be used to run other "modules"
how do i get the framework to tell ManCommands to send the command sent to the framework to the ProccessCommand method it BasicModule1>
I've taught Smalltalk to a lot of people. Based on that experience, I think you are heading in the wrong direction. You probably shouldn't be talking about modules, but about classes. You shouldn't think about a module that runs other modules. Further, classes are objects, so you usually don't pass names of classes around, but the classes themselves.
Is this your first Smalltalk system?
-Ralph Johnson
ok, this is the Framework class:
Framework>>getInput ^input Framewor>>prompt: aString "Not yet finished, will be sent to a UI eventually"
On 1/3/08, Leandro Caniglia caniglia@dm.uba.ar wrote:
OK. Then just show us some of your source code so we can figure out what you are trying to do.
/Leandro
*From:* squeak-dev-bounces@lists.squeakfoundation.org [mailto: squeak-dev-bounces@lists.squeakfoundation.org] *On Behalf Of *David Zmick *Sent:* Wednesday, January 02, 2008 8:00 PM *To:* The general-purpose Squeak developers list *Subject:* Re: my Framework
yes, it is my first, but i understand all of the classes, etc. I want to make an expandable cryptology system that will have other classes with certain methods to control the framework, or base class, its just fancy words
On 1/2/08, *Ralph Johnson* johnson@cs.uiuc.edu wrote:
On Jan 2, 2008 1:39 PM, David Zmick dz0004455@gmail.com wrote:
i am working on a program with a framework, and modules that will plug
into
it, and i need to know how to send a class name around. for example: i
have
a method in one class, that servers as a module, that will "Procces Commands" sent to the framework. I have another class that is suposed to manage the commands and getting them to the right place.
ManCommands-the command managing class
Framework-the framework that manages input/output
BasicModule1-a module that will eventually be used to run other
"modules"
how do i get the framework to tell ManCommands to send the command sent
to
the framework to the ProccessCommand method it BasicModule1>
I've taught Smalltalk to a lot of people. Based on that experience, I think you are heading in the wrong direction. You probably shouldn't be talking about modules, but about classes. You shouldn't think about a module that runs other modules. Further, classes are objects, so you usually don't pass names of classes around, but the classes themselves.
Is this your first Smalltalk system?
-Ralph Johnson
On 1/3/08, David Zmick dz0004455@gmail.com wrote:
ok, this is the Framework class:
Object subclass: #Framework instanceVariableNames: 'input activeModule' classVariableNames: '' poolDictionaries: '' category: 'dz-CrypticSqueak'
Framework>>getInput ^input Framewor>>prompt: aString "Not yet finished, will be sent to a UI eventually" Transcript cr; show: aString; cr.
Framework input: aString input := aString.
A Basic "module"
BasicModule>>ManCommand: "Tells the framework what to do when it gets a method"
BasicModule>>initialize framework := Framework new.
The class that manages where the commands go, all of the commands, in a way it is part of the framework.
ManCommands>>sendCommand: aCommandString
mod = BasicModule new. "THIS IS NOT WHAT I WANT!! BAD!!!" mod ManCommand: aCommandString.
then there are always some accessors thats just basically how it works.
One more question...How do I know when i need to use a class method instead of an instance method?
On 1/3/08, Leandro Caniglia caniglia@dm.uba.ar wrote:
OK. Then just show us some of your source code so we can figure out what you are trying to do.
/Leandro
*From:* squeak-dev-bounces@lists.squeakfoundation.org [mailto:squeak-dev-bounces@lists.squeakfoundation.org ] *On Behalf Of *David Zmick *Sent:* Wednesday, January 02, 2008 8:00 PM *To:* The general-purpose Squeak developers list *Subject:* Re: my Framework
yes, it is my first, but i understand all of the classes, etc. I want to make an expandable cryptology system that will have other classes with certain methods to control the framework, or base class, its just fancy words
On 1/2/08, *Ralph Johnson* < johnson@cs.uiuc.edu> wrote:
On Jan 2, 2008 1:39 PM, David Zmick < dz0004455@gmail.com> wrote:
i am working on a program with a framework, and modules that will plug
into
it, and i need to know how to send a class name around. for example: i
have
a method in one class, that servers as a module, that will "Procces Commands" sent to the framework. I have another class that is suposed
to
manage the commands and getting them to the right place.
ManCommands-the command managing class
Framework-the framework that manages input/output
BasicModule1-a module that will eventually be used to run other
"modules"
how do i get the framework to tell ManCommands to send the command
sent to
the framework to the ProccessCommand method it BasicModule1>
I've taught Smalltalk to a lot of people. Based on that experience, I think you are heading in the wrong direction. You probably shouldn't be talking about modules, but about classes. You shouldn't think about a module that runs other modules. Further, classes are objects, so you usually don't pass names of classes around, but the classes themselves.
Is this your first Smalltalk system?
-Ralph Johnson
sorry i sent it like that, i messed up.
On 1/3/08, David Zmick dz0004455@gmail.com wrote:
On 1/3/08, David Zmick dz0004455@gmail.com wrote:
ok, this is the Framework class:
Object subclass: #Framework instanceVariableNames: 'input activeModule' classVariableNames: '' poolDictionaries: '' category: 'dz-CrypticSqueak'
Framework>>getInput ^input Framewor>>prompt: aString "Not yet finished, will be sent to a UI eventually" Transcript cr; show: aString; cr.
Framework input: aString input := aString.
A Basic "module"
BasicModule>>ManCommand: "Tells the framework what to do when it gets a method"
BasicModule>>initialize framework := Framework new.
The class that manages where the commands go, all of the commands, in a way it is part of the framework.
ManCommands>>sendCommand: aCommandString
mod = BasicModule new. "THIS IS NOT WHAT I WANT!! BAD!!!" mod ManCommand: aCommandString.
then there are always some accessors thats just basically how it works.
One more question...How do I know when i need to use a class method instead of an instance method?
On 1/3/08, Leandro Caniglia <caniglia@dm.uba.ar > wrote:
OK. Then just show us some of your source code so we can figure out what you are trying to do.
/Leandro
*From:* squeak-dev-bounces@lists.squeakfoundation.org [mailto:squeak-dev-bounces@lists.squeakfoundation.org ] *On Behalf Of *David Zmick *Sent:* Wednesday, January 02, 2008 8:00 PM *To:* The general-purpose Squeak developers list *Subject:* Re: my Framework
yes, it is my first, but i understand all of the classes, etc. I want to make an expandable cryptology system that will have other classes with certain methods to control the framework, or base class, its just fancy words
On 1/2/08, *Ralph Johnson* < johnson@cs.uiuc.edu> wrote:
On Jan 2, 2008 1:39 PM, David Zmick < dz0004455@gmail.com> wrote:
i am working on a program with a framework, and modules that will
plug into
it, and i need to know how to send a class name around. for example:
i have
a method in one class, that servers as a module, that will "Procces Commands" sent to the framework. I have another class that is
suposed to
manage the commands and getting them to the right place.
ManCommands-the command managing class
Framework-the framework that manages input/output
BasicModule1-a module that will eventually be used to run other
"modules"
how do i get the framework to tell ManCommands to send the command
sent to
the framework to the ProccessCommand method it BasicModule1>
I've taught Smalltalk to a lot of people. Based on that experience, I think you are heading in the wrong direction. You probably shouldn't be talking about modules, but about classes. You shouldn't think about a module that runs other modules. Further, classes are objects, so you usually don't pass names of classes around, but the classes themselves.
Is this your first Smalltalk system?
-Ralph Johnson
In general, before you try to build a framework for something, you should build some applications for that problem. The right way to build a framework is to generalize from applications.
See http://st-www.cs.uiuc.edu/~droberts/evolve.html
So, what are your applications?
-Ralph Johnson
i dont have any. i wasnted to build a base for everything and then develop stuff over it, but i see what you are saying, i shouldn't have to do that in an object-oriented language. especialy smalltalk
On 1/3/08, Ralph Johnson johnson@cs.uiuc.edu wrote:
In general, before you try to build a framework for something, you should build some applications for that problem. The right way to build a framework is to generalize from applications.
See http://st-www.cs.uiuc.edu/~droberts/evolve.html
So, what are your applications?
-Ralph Johnson
"Ralph" == Ralph Johnson johnson@cs.uiuc.edu writes:
Ralph> In general, before you try to build a framework for something, you Ralph> should build some applications for that problem. The right way to Ralph> build a framework is to generalize from applications.
Ralph> See http://st-www.cs.uiuc.edu/~droberts/evolve.html
heh... I was about to type "and I've never been able to develop a framework without implementing things at least *three* times" when I started reading that URL. Very nice.
You have to implement something *three* times before you start a framework because otherwise you won't know what dials and levers are connected, and what dials and levers are independent. With three data points, you can at least start to make a guess.
Hello David,
DZ> One more question...How do I know when i need to use a class DZ> method instead of an instance method?
the obvious reply is: If you want to talk to the class you need a message implemented as a class side method. Examples:
a := Float pi asks the class Float to return an instance of Float with the value of pi. So you'll find the method pi implemented on the class side of float.
then a:= a + 3.0 talks to an instance of Float so you'll find + implemented on the instance side of Float (or on of its superclasses).
Cheers, Herbert mailto:herbertkoenig@gmx.net
ok, Thanks! that clears it up a lot!! happy coding!
On 1/3/08, Herbert König herbertkoenig@gmx.net wrote:
Hello David,
DZ> One more question...How do I know when i need to use a class DZ> method instead of an instance method?
the obvious reply is: If you want to talk to the class you need a message implemented as a class side method. Examples:
a := Float pi asks the class Float to return an instance of Float with the value of pi. So you'll find the method pi implemented on the class side of float.
then a:= a + 3.0 talks to an instance of Float so you'll find + implemented on the instance side of Float (or on of its superclasses).
Cheers, Herbert mailto:herbertkoenig@gmx.net
Hi David
Since this is your first Smalltalk project, understanding the roles of messages, objects and classes from the POV of ST will help you.
There are pretty good introductions to ST and/or OO concepts, like this one:
http://www.chronos-st.org/Smalltalk-Getting-the-Message.html
Cheers
Carlos
On Jan 3, 2008 1:22 PM, David Zmick dz0004455@gmail.com wrote:
ok, Thanks! that clears it up a lot!! happy coding!
On 1/3/08, Herbert König herbertkoenig@gmx.net wrote:
Hello David,
DZ> One more question...How do I know when i need to use a class DZ> method instead of an instance method?
the obvious reply is: If you want to talk to the class you need a message implemented as a class side method. Examples:
a := Float pi asks the class Float to return an instance of Float with the value of pi. So you'll find the method pi implemented on the class side of float.
then a:= a + 3.0 talks to an instance of Float so you'll find + implemented on the instance side of Float (or on of its superclasses).
Cheers, Herbert mailto:herbertkoenig@gmx.net
i have the book "Squeak by Example" and i'm reading about that right now!
On 1/3/08, Carlos Lenz carlos.lenz@gmail.com wrote:
Hi David
Since this is your first Smalltalk project, understanding the roles of messages, objects and classes from the POV of ST will help you.
There are pretty good introductions to ST and/or OO concepts, like this one:
http://www.chronos-st.org/Smalltalk-Getting-the-Message.html
Cheers
Carlos
On Jan 3, 2008 1:22 PM, David Zmick dz0004455@gmail.com wrote:
ok, Thanks! that clears it up a lot!! happy coding!
On 1/3/08, Herbert König herbertkoenig@gmx.net wrote:
Hello David,
DZ> One more question...How do I know when i need to use a class DZ> method instead of an instance method?
the obvious reply is: If you want to talk to the class you need a message implemented as a class side method. Examples:
a := Float pi asks the class Float to return an instance of Float with the value of pi. So you'll find the method pi implemented on the class side of float.
then a:= a + 3.0 talks to an instance of Float so you'll find + implemented on the instance side of Float (or on of its superclasses).
Cheers, Herbert mailto:herbertkoenig@gmx.net
squeak-dev@lists.squeakfoundation.org