Hey all, looking for a better method to design large integrated classes. My background is (in a nutshell) BASIC->C->PHP->Java, so essentially I cut my teeth on alot of procedural code and am now waist deep in OOP design. Up to this point I've done alot of reusable functions, some class design. My normal method is to scratch some ideas out and build a skeleton class, work from that until I have a final revision, test, test, test.
So, does anyone work seriously with CRC, UML, etc?
Class modeling: CRC cards, UML, what?
Moderator: General Moderators
- Buddha443556
- Forum Regular
- Posts: 873
- Joined: Fri Mar 19, 2004 1:51 pm
I'm not sure I'm ever very serious however I use CRC occasionally.
I use CRC because:
I use CRC because:
- It's simple. No software needed. A pencil, an eraser and some paper is all that's needed ... maybe a big table if I don't feel like crawling around the floor.
- Fits my size projects. I'm a solo-developer, project can't be too large or I may starve to death before I get paid.
- Keeps me from going details nuts. Oh ... not about the OOD but the pretty little pictures. I sometime seem to be some sort of frustrated artist. I get this urge to run down to Kinkos and print the diagrams big enough for framing. Using software for such a task sort of shifts my focus in that way.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Class modeling: CRC cards, UML, what?
Build small independent classes instead.bdlang wrote:Hey all, looking for a better method to design large integrated classes.
Sounds familiarbdlang wrote:My background is (in a nutshell) BASIC->C->PHP->Java, so essentially I cut my teeth on alot of procedural code and am now waist deep in OOP design. Up to this point I've done alot of reusable functions, some class design. My normal method is to scratch some ideas out and build a skeleton class, work from that until I have a final revision, test, test, test.
So, does anyone work seriously with CRC, UML, etc?
(#10850)
Re: Class modeling: CRC cards, UML, what?
Arborint is 100% on the money.arborint wrote:Build small independent classes instead.
For me, paper is a horrid distraction. I sit down and think through the overall vision of a project. I usually picture a large cloud, made of different sections of color. I mentally spin around the multi-color cloud, and start verbally describing the sections. "Here is the database access cloud", "Here is the way logins will be handled", and so on.
Once I've described most of the cloud, I can usually "feel" one that isn't fitting in right. Something is ugly, out of place, not well designed.. The hip term for it right now is "bad code smells". That section I zero in on, and start thinking about what it "should" be doing.
Then I look at the code, and nine times out of ten, its not doing what I think it should be doing. Where I go from there depends on whether its OOP code or legacy code. If its OOP, I start breaking it up into smaller classes and objects, refactoring as I go, writing tests for areas that aren't tested.
If its procedural, I look for ways to simplify, make the functions more 'correct', and make it do what it should be doing.
How do you eat an elephant?
One bite at a time.
Re: Class modeling: CRC cards, UML, what?
Regardless of whether it was meant in a joking manner, I got a good laugh out of that one.arborint wrote:Build small independent classes instead.bdlang wrote:Hey all, looking for a better method to design large integrated classes.
Precisely. I meant to say 'large group of integrated classes', as in an application made up mostly of classes, ala Java vs. a nasty hybrid of classes and procedural code which seems to be my nemesis.
- Christopher
- Site Administrator
- Posts: 13596
- Joined: Wed Aug 25, 2004 7:54 pm
- Location: New York, NY, US
Re: Class modeling: CRC cards, UML, what?
No joke. I would take a well designed, modular procedural code with clear dependencies over sloppy OO code any day. Good design is always the bottom line -- and good design comes from three main sources: experience, learning from the best thinkers of our day, and peer review. If you can get those then cards and diagrams become more of a communication and documentation tool than anything else.bdlang wrote:Regardless of whether it was meant in a joking manner, I got a good laugh out of that one.
Precisely. I meant to say 'large group of integrated classes', as in an application made up mostly of classes, ala Java vs. a nasty hybrid of classes and procedural code which seems to be my nemesis.
(#10850)