Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Newbie: Starting Design Process

Status
Not open for further replies.

lespaul

Programmer
Feb 4, 2002
7,083
US
So, how do I start? I work at the largest and busiest court in the state. Most of the previous development has been haphazard and not well thought out and I'd like to change that. I am not an expert in OOP although I understand most of the concepts and have been reading up on classes, methods and properties. I've read several threads in the forum regarding the design process, but even those are a little advanced for what I'm looking for, I need help with the baby steps!

Do I start by writing all the processes? From the time the citation or arrest occurs through the completion of sentencing? What if the process is different based on what kind of citation was issued?

Once I get it all written down, I find the nouns and make those classes and the verbs become functions?

I appreciate any advice/direction on how to start something like this.

Thanks,


Leslie

Anything worth doing is a lot more difficult than it's worth - Unknown Induhvidual

Essential reading for database developers:
The Fundamentals of Relational Database Design
Understanding SQL Joins
 
Do you know how to use UML?
It might help if you started out by listing all the requirements in detail, then creating some UML diagrams (class, state, timing...).

Once you have the UML diagrams figured out, creating the classes should be simple.
 
No, I saw that in some of the other posts and I'm looking into it, but I don't know anything about how to get started with that either.

Thanks,
leslie
 
I've just finished downloading and install an eval version of Visual paradigm for UML, and low and behold there's Case, State and Sequence diagrams!

I'll play around with those and go through their documentation and I'll see if I can find some books in our Safari account that will help.

I'm sure I'll post back if I get stuck!

Thanks!
Leslie
 
Ok, so I've done some reading on specifications with UML, and I still am not getting it. I decided I would try a small process/project that I'm working on just to try it out, but I can't get my head around what I'm suppose to do.

Here's a brief description of the small project I'm currently putting together.

[tt]When a person gets a traffic ticket they have two choices, get a court date for arraignment or plead guilty to the officer and pay the fine to another agency. If the person has selected to come to court, on the date listed on the ticket the defendant shows up for court. A clerk in the Traffic Arraignment room "checks in" the defendant. Once a defendant is checked in, they meet with a City Attorney. At this point they have two choices:
1. Plead 'Not Guilty' and get a court date set in the future
2. Make a deal with the City Attorney's office

If 2 is selected then a 'Plea Agreement' is produced which is signed by the defendant and the Prosecutor.

Once the City Attorney has seen the defendant, they are brought before the judge. If option 1 was selected the defendant gets a court date for trial scheduled in the future. If option 2 was selected and the defendant has reached an agreement, the judge approves/modifies the agreement and then signs a document 'Judgment & Sentencing'.

Each defendant has a CASE which consists of one or more tickets (CHARGES).[/tt]

There are some behind the scenes process that take place as well. For example, when the judge approves the agreement and produces & signs the 'Judgment & Sentencing', the table that stores the Sentencing has records inserted based on the sentencing selected.

I'm still looking into getting my Safari account back and trying to find a good book to read...do you have any suggestions for books on Learning UML?

Thanks!
Leslie
 
My book is at home, but I think this is the one I have:

It wasn't too bad, but everyone has different learning styles, so all I can suggest is to look at a few different books to see which you like better. Some people like lots of examples, some like less...

That description of the process you have sounds pretty thorough. You can look for the nouns and verbs and start creating a class diagram from them.
Nouns will be classes and verbs would be functions, so "person" & "Traffic ticket" would be classes.
"get" would be a function; specifically I'd make it a member of the Person class and it would take a TrafficTicket as a parameter.

Once you've got that all done, try looking for missing pieces of info and ask someone there about it. One example of a "what if" question might be "what if the person pleads not guilty, but doesn't show up for the trial?"

Keep updating the class diagram with the new info you get until you're pretty sure you have all the pieces of the puzzle.

You can also create State & Sequence diagrams, which might also help you to find more "what if" questions...
 
Martin Fowler's UML Distilled (Addison-Wesley) is a good book. Covers what you need to know, and leaves out much of the more esoteric stuff you don't. Make sure you get the latest edition, as UML gets updated from time to time.

I'm reading Use Case Driven Object Modelling by Rosenberg and Stephens (Apress), which advocates a stripped-down approach (ICONIX) for driving out the design. I've not tried it out for real, but what I've read so far does make a lot of sense.

Personally, I like Enterprise Architect from Sparx systems as a modelling tool. You can get a 30-day demo of that too.
Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Ok, I'm reading the UML Distilled book now and have a question about how to structure the classes. I not only want to use these classes in this project, I'd like to start planning on using them in other projects. So not only are there criminal defendants, we have attorneys, plaintiffs and civil defendants. Is it best practice to have a single class 'Person' that contains all the attributes common to Person and then have "sub-classes" for Attorney, that store their bar number or office address? Should 'Address' be another class that the Person class includes? So Person would have an attribute of 'Address' but that's it's own class, so it has the attributes: StreetAddress, City, State and Zipcode?

Am I getting all this right?

Thanks for your help!

Leslie
 
No. by all means have a Person class. It might have a surname, forename, DOB, etc.

A Person can have a collection of roles, which could be Plaintiff, Attorney, Judge etc. So if an attorney gets divorced, or a judge gets arrested in a rent-boy scandal, you can still deal with it when they show up on the wrong side of the court...

Addresses are tricky. People move house frequently, and I guess plaintiffs change theirs all the time as part of the job. Consider having a start date and a nullable end date. But by putting them in a separate class, you can use it for home or office addresses.

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
OK, in this context perhaps Collection is a bad choice of words. A Person can have a role as a Judge. So you have an association between Person and Judge. The role of Judge is linked to many Cases. Another association.

If the Judge gets a speeding ticket, his Person gets a role as a Plaintiff. The fact that he's a Judge plays no part in this (in our idealised model world, anyway). His Plaintiff role gets linked to a Case. Some other Person, in their role as a Judge would be connected to the same Case.

If we were to go down the subclassing route, where Judge and Plaintiff were both subclasses of Person, then he couldn't be both a judge and a Plaintiff at the same time. So we'd need two objects to represent the same Person, and have to be able to manage them.

Does this make sense?

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Also, one thing to note when designing the Address info -- pleeeeease don't make the design so restricted that only U.S. addresses in a specific format can be entered. After moving back to Canada, I had a hell of a time trying to get places like the DMV or my U.S. banks & credit cards updated with my new address, since their systems refused to accept a Canadian postal code instead of a ZIP code... [thumbsdown]
 
I'll be sure to take the foreign addresses into account!

I'm still stuck on how I capture information about different types of people. A criminal defendant we capture SSN, DOB, Height, Weight, etc. For a civil defendant all we need to know is the address information.

Do I create a class 'CriminalDefendant' that extends the person class?

Thanks for all your input...hopefully I'll eventually "get it"!

leslie
 
and I don't think I got a clear answer to:

Should 'Address' be another class that the Person class includes? So Person would have an attribute of 'Address' but that's it's own class, so it has the attributes: StreetAddress, City, State and Zipcode?

Is the above what I'm going to want to do?
 
You could have an Address base class, then create specific address classes for US, Canada... maybe also a FreeForm address class that doesn't impose any restrictions on the fields in case you don't have time to create hundreds of address sub-classes ;-)
 
les, if I hadn't done so already, if I were you I'd take a step back and create use case diagrams before I put too much work into class design. You don't want to create a design and have people say "but that's not what I meant at all. That is not it, at all." (Apologies to T. S. Eliot...)

Furthermore, the "activity diagram" is a good way to diagram the "brief description" you provided. Finally, investigate "use case scenarios" as a means of documenting divergent paths in the activity diagram.

"The UML Bible", Tom Pender, Wiley Publishing is my favorite book on UML. Fowler's is a close second. For MASSIVE information on OOP in general, take a look at
HTH

Bob
 
At this point I'm just poking around. I've been looking at all the different diagrams in the Visual Paradigm software I downloaded and doing research on what all the different diagrams are for.

I've done the Use Case and Activity diagrams (I think) for the scenario above and think I've got those pretty laid out....

I'm having to put out fires the past few work days and haven't made it back to this, which is just FLUFF, don't you know! Why bother to fix the underlying issues when we can spend lots of time fixing the problems that arise from the underlying issues.

I'll be sure to post back once I've made a little more progress. I've ordered Case Studies in Object-Oriented Analysis and Design by Yourdon and I'm hoping that a case study will help direct me the ways I need to go. I like case studies...

Leslie

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top