Hello Jimmie,
Allow me to make just some general remarks concerning OO analysis:
From: Jimmie Houchin jhouchin@texoma.net Hello,
I am wanting/trying to move some homebrew software I wrote at work in MSWorks to Squeak. It is a database application.
Porting a non-OO software to Smalltalk is a really hard job: You have to switch from thinking in data structures to thinking in objects and rethink *everything*. I don't envy you for the task you want to do.
It is a person database with close to 200 fields. Not all fields are an attribute of person, but I am very contrained with MSWorks. Alas, it was all I had available.
What is a database? If you know, try to forget it for the moment. The question is: what is the data used for? Don't think about storage of data - there is the image, that is all for now, care about the details later...
The JHPerson class could easily have dozens of instance variables. But what I had been thinking is to group common variables into new classes similar to but not necessarily exactly:
JHPersonName (first, middle, last, maiden, suffix) JHPersonBirth (date, place) JHPersonDeath (date, place) JHPersonMarriage (list of (dates, places, spouses)) JHPersonAddress (street, city, county, state, zip) JHPersonOccupation (title, industry) JHPersonEducation (numYears, listOfSchools) ... lots more data ...
You are listing a data structure, not a collaboration of objects. The question is: What are the tasks you want to do that you need all that data for? Forget about most of the data first (you can add it later) and ask for responsibilities: What shall a "Person" be able to do? Or try it the other way around: e.g. what is it, that I do with the information which education a person has? The answer names a responsibility and the follow-up question is: which object should carry that responsibility. Draw CRC-Cards and play with them. First figure out what an object can do (and this shouldn't be: "Show me the date of birth", but e.g. "Notify me if somebody has birthday today") and then ask what it has to know in order to accomplish its tasks.
Christian
Christian Hofer wrote:
Hello Jimmie,
Hello Christian,
Allow me to make just some general remarks concerning OO analysis:
Yes, please.
From: Jimmie Houchin jhouchin@texoma.net Hello,
I am wanting/trying to move some homebrew software I wrote at work in MSWorks to Squeak. It is a database application.
Porting a non-OO software to Smalltalk is a really hard job: You have to switch from thinking in data structures to thinking in objects and rethink *everything*. I don't envy you for the task you want to do.
Fortunately I am currently the developer and sole user of this application. The requirements and standards are mine alone at this point.
It is a person database with close to 200 fields. Not all fields are an attribute of person, but I am very contrained with MSWorks. Alas, it was all I had available.
What is a database? If you know, try to forget it for the moment. The question is: what is the data used for? Don't think about storage of data - there is the image, that is all for now, care about the details later...
The JHPerson class could easily have dozens of instance variables. But what I had been thinking is to group common variables into new classes similar to but not necessarily exactly:
JHPersonName (first, middle, last, maiden, suffix) JHPersonBirth (date, place) JHPersonDeath (date, place) JHPersonMarriage (list of (dates, places, spouses)) JHPersonAddress (street, city, county, state, zip) JHPersonOccupation (title, industry) JHPersonEducation (numYears, listOfSchools) ... lots more data ...
You are listing a data structure, not a collaboration of objects. The question is: What are the tasks you want to do that you need all that data for? Forget about most of the data first (you can add it later) and ask for responsibilities: What shall a "Person" be able to do? Or try it the other way around: e.g. what is it, that I do with the information which education a person has? The answer names a responsibility and the follow-up question is: which object should carry that responsibility. Draw CRC-Cards and play with them. First figure out what an object can do (and this shouldn't be: "Show me the date of birth", but e.g. "Notify me if somebody has birthday today") and then ask what it has to know in order to accomplish its tasks.
You are quite correct it is very much a data structure.
It will be a change of thinking to enable the app to be different. It is a Vital Statistics and Geneological type application. It is used for filling out government and other forms.
There aren't many behaviours for the objects other than ensuring data integrity and filling out my forms.
I may very well be under estimating what I can do based on what I currently do.
Fortunately I could move the app to Squeak in a much improved and more functional level and over time refactor into those capabilities you speak of.
Thanks for provoking thought.
Jimmie Houchin
It will be a change of thinking to enable the app to be different. It is a Vital Statistics and Geneological type application. It is used for filling out government and other forms.
It might be of interest to take a look at some student projects done last semester to create a geneological application in Squeak.
The students write up "cases" for extra credit on their approach to the problem, designs and solutions. Of course the downside is that many of the "best" applications don't get documented because the students know they do not need the extra credit.
Still these might be useful, and the code might save you some time.
Go to the course SWIKI at: http://coweb.cc.gatech.edu/cs2340/17
and look at Fall 2002 cases. Milestone 3 was their major design presentation and might give you some ideas.
These applications can import/export GEDCOM format data and can populate their data from web-based resources.
Jimmie Houchin
Bob
Hi Bob,
Thanks for the information. I'll explore the resources and see what I can learn and use.
Jimmie Houchin
Robert Waters wrote:
It will be a change of thinking to enable the app to be different. It is a Vital Statistics and Geneological type application. It is used for filling out government and other forms.
It might be of interest to take a look at some student projects done last semester to create a geneological application in Squeak.
The students write up "cases" for extra credit on their approach to the problem, designs and solutions. Of course the downside is that many of the "best" applications don't get documented because the students know they do not need the extra credit.
Still these might be useful, and the code might save you some time.
Go to the course SWIKI at: http://coweb.cc.gatech.edu/cs2340/17
and look at Fall 2002 cases. Milestone 3 was their major design presentation and might give you some ideas.
These applications can import/export GEDCOM format data and can populate their data from web-based resources.
Jimmie Houchin
Bob
squeak-dev@lists.squeakfoundation.org