Proper Smalltalk lots of classes

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Proper Smalltalk lots of classes

Jimmie Houchin-5
Hello,

I am porting the FIX protocol to Squeak/Pharo.
http://www.fixprotocol.org/

It is the Financial Information eXchange protocol. It is used by many
firms in the financial industries, stocks, forex, etc.

There is good documentation and also a semi-reference implementation in
Java.
http://www.quickfixj.org

I have a partial port started but I wanted a check with those who know
more than I about proper Smalltalk coding.

In the Java implementation there are over 2000 classes. In the protocol
there are approximately 90 message types and 956 field types.

I am initially creating the message classes as they form the basis of
the protocol and the fields are simply instance variables and methods in
the message classes.

I am not porting the Java library. I am implementing the protocol in
Smalltalk from the documentation.

Initially I have created a Fix44Field class with its necessary variables.
There are several versions of the Protocol and FIX 4.4 is the one
required for my application.

With this Fix44Field class I am creating a Dictionary with the 956
different field types. I am planning on creating a constructor method
which will create the desired field from the information in the
dictionary about the field and its properties.

Am I way off base here? Should I really create the 956 classes necessary
to for each field in addition to the 90 or so message classes, and then
I don't know what else I haven't discovered yet. Having 1000+ classes
just seems unwieldy and naively it just doesn't feel like the Smalltalk
way. I could be wrong, but I haven't seen such an example to my memory.
I don't know enough about Java to know if it is good Java form either.

When I have a reasonably fleshed out, tested and working solution, I
will make the source available under a MIT license. I would love to see
Squeak/Pharo become an out of the box viable option for trading
applications.

Advise and wisdom greatly appreciated.

Thanks.

Jimmie

Reply | Threaded
Open this post in threaded view
|

Re: Proper Smalltalk lots of classes

Stéphane Ducasse

> Hello,
>
> I am porting the FIX protocol to Squeak/Pharo.
> http://www.fixprotocol.org/
>
> It is the Financial Information eXchange protocol. It is used by many firms in the financial industries, stocks, forex, etc.


Excellent!


>
> There is good documentation and also a semi-reference implementation in Java.
> http://www.quickfixj.org
>
> I have a partial port started but I wanted a check with those who know more than I about proper Smalltalk coding.
>
> In the Java implementation there are over 2000 classes. In the protocol there are approximately 90 message types and 956 field types.
>
> I am initially creating the message classes as they form the basis of the protocol and the fields are simply instance variables and methods in the message classes.

do you have some examples because replying like that in the blue is difficult.



> I am not porting the Java library. I am implementing the protocol in Smalltalk from the documentation.
>
> Initially I have created a Fix44Field class with its necessary variables.
> There are several versions of the Protocol and FIX 4.4 is the one required for my application.
>
> With this Fix44Field class I am creating a Dictionary with the 956 different field types. I am planning on creating a constructor method which will create the desired field from the information in the dictionary about the field and its properties.

this sounds right.
or you can have a method that takes a list and fill up

>
> Am I way off base here? Should I really create the 956 classes necessary to for each field in addition to the 90 or so message classes, and then I don't know what else I haven't discovered yet. Having 1000+ classes just seems unwieldy and naively it just doesn't feel like the Smalltalk way.

For me number of classes has never been a design criteria. Now is the behavior different on each of them? what are the variations?
Can we represent them as constant in a classVar somewhere?

> I could be wrong, but I haven't seen such an example to my memory. I don't know enough about Java to know if it is good Java form either.
>
> When I have a reasonably fleshed out, tested and working solution, I will make the source available under a MIT license. I would love to see Squeak/Pharo become an out of the box viable option for trading applications.

me toooooooooooo :)

>
> Advise and wisdom greatly appreciated.
>
> Thanks.
>
> Jimmie
>


Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] Proper Smalltalk lots of classes

Jan van de Sandt
In reply to this post by Jimmie Houchin-5
Hello Jimmie,

I had to do something similar a while ago. I had to support a complex XML schema for a standard message format of the Dutch government (StUF).

The Java implementation used JAXB to generate a few thousand data objects. Very clumsy.

In Smalltalk I made some code to generate Magritte descriptions for all the structure and field definitions in the XML schema. Using the Magritte descriptions it was very easy to read and write messages in the correct format. I created real classes only for the few message types that required some logic. For all the other message types I used some generic class that stores the values in a dictionary.

So my advice is to have a look at Magritte. It can help you handle the type information without creating/generating lots of classes.

Jan.



On Fri, Dec 31, 2010 at 11:24 PM, Jimmie Houchin <[hidden email]> wrote:
Hello,

I am porting the FIX protocol to Squeak/Pharo.
http://www.fixprotocol.org/

It is the Financial Information eXchange protocol. It is used by many firms in the financial industries, stocks, forex, etc.

There is good documentation and also a semi-reference implementation in Java.
http://www.quickfixj.org

I have a partial port started but I wanted a check with those who know more than I about proper Smalltalk coding.

In the Java implementation there are over 2000 classes. In the protocol there are approximately 90 message types and 956 field types.

I am initially creating the message classes as they form the basis of the protocol and the fields are simply instance variables and methods in the message classes.

I am not porting the Java library. I am implementing the protocol in Smalltalk from the documentation.

Initially I have created a Fix44Field class with its necessary variables.
There are several versions of the Protocol and FIX 4.4 is the one required for my application.

With this Fix44Field class I am creating a Dictionary with the 956 different field types. I am planning on creating a constructor method which will create the desired field from the information in the dictionary about the field and its properties.

Am I way off base here? Should I really create the 956 classes necessary to for each field in addition to the 90 or so message classes, and then I don't know what else I haven't discovered yet. Having 1000+ classes just seems unwieldy and naively it just doesn't feel like the Smalltalk way. I could be wrong, but I haven't seen such an example to my memory. I don't know enough about Java to know if it is good Java form either.

When I have a reasonably fleshed out, tested and working solution, I will make the source available under a MIT license. I would love to see Squeak/Pharo become an out of the box viable option for trading applications.

Advise and wisdom greatly appreciated.

Thanks.

Jimmie