Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

indentifying classes

 
Ranch Hand
Posts: 260
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi all,
I have this persisting problem of not knowing how to identify classes and how to deligate responsibilities to them?
I am aware of a couple of methods like CRC cards,making the nouns in your problem statement as classes.
I want to know if anyone has used the CRC cards method to identify classes and will be thankful if someone educates me abt the pros and cons of this method?
Thanks in advance
william
 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by william kane:
I am aware of a couple of methods like CRC cards,making the nouns in your problem statement as classes.
I want to know if anyone has used the CRC cards method to identify classes and will be thankful if someone educates me abt the pros and cons of this method?


I think CRC cards are outdated today. Linguistic analysis is one of the approaches to identify classes. But use case approach is in my opinion is the best approach.
[ September 24, 2003: Message edited by: Murthy Narasimha ]
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Murthy Narasimha:
I think CRC cards are outdated today.


Uh oh. I see a horde of agile proponents coming your way with angry impressions... Seriously, CRC cards may be an "old" technique but that doesn't invalidate their effect when it comes to getting the job done.
 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by william kane:
Hi all,
I want to know if anyone has used the CRC cards method to identify classes and will be thankful if someone educates me abt the pros and cons of this method?
Thanks in advance
william


Here is an example for CRC cards:
http://www.math-cs.gordon.edu/local/courses/cs211/ATMExample/
However, I have found that identifying components first helps in identifying classes:
http://www.mycgiserver.com/~nsenthil/articles/auctiondbdesign.html
Nalla
 
(instanceof Sidekick)
Posts: 8791
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I usually start by making collaboration diagrams for use case scenarios. You can usually start with the obvious nouns in the business domain plus a controller to synchronize things. Often the controller can be reduced or removed over time by refining all the responsibilities. Some people prefer to leave them out all along. You might have an activity where you bring all the scenario-sized diagrams together to assure that each object is used consistently in every scenario. Or you might just have CRC cards on the wall that everyone looks at as they go to assure consistency.
The outcome is an analysis model, one that helps you understand the problem but not necessarily the solution. The transition to a design model is more mystical than mechanical. Some domain objects disappear, some implementation objects are added, architecture influences (like, do we have stateful objects?) are mixed in.
If you are very agile, you and your pair partner might do all this in ten minutes on a napkin or whiteboard it at the daily team standup meeting right before you start writing unit tests.
 
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Murthy Narasimha:
[QB]I think CRC cards are outdated today.


Why?
 
Idly Vada
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Ilja Preuss:
Why?


I think CRC cards approach takes us back to the stone-age approach of designing system on paper. You should design system on paper and write code matching this design. Every time you make changes to design, you should manually change code.
In UML appraoch, changes in design will be automaticlly reflected in the code.This gives traceability.You can apply things like design patterns at design and thsese will b automatically reflected in code.
In CRC appraoch(in my opinion) therez no traceability.
 
Ranch Hand
Posts: 5093
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Murthy Narasimha:

I think CRC cards approach takes us back to the stone-age approach of designing system on paper. You should design system on paper and write code matching this design. Every time you make changes to design, you should manually change code.
In UML appraoch, changes in design will be automaticlly reflected in the code.This gives traceability.You can apply things like design patterns at design and thsese will b automatically reflected in code.
In CRC appraoch(in my opinion) therez no traceability.


Oh no, not the myth of automatically written applications from UML diagrams.
Code generation in general is evil and should be avoided apart from maybe such things as database access code.
 
Lasse Koskela
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Murthy, people who use CRC cards tend to think of design as a process, not a result. They're looking for different benefits from CRC cards than a typical UML artist is looking for from her diagrams.
 
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

They're looking for different benefits from CRC cards than a typical UML artist is looking for from her diagrams.


One of those benefits is a communication medium. Domain experts often do not have knowledge of OO or UML.
 
Idly Vada
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Rufus BugleWeed:
One of those benefits is a communication medium. Domain experts often do not have knowledge of OO or UML.


Do the domain experts know completely about CRC cards? Can CRC cards depict intricate aspects of design?
 
Sheriff
Posts: 17031
298
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Each tool has it's own practical application. Just because a tool has been around for a while doesn't mean it's out of date or that if you use it you're a Luddite. Carpenters are still known to use plain old hammers in spite the availability of the automatic, pneumatic ones. It all depends on what you need to do.
[ September 26, 2003: Message edited by: Junilu Lacar ]
 
Rufus BugleWeed
Ranch Hand
Posts: 1551
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Do the domain experts know completely about CRC cards?


Business Analyst walks end user though use case and CRC development.
BA may draw BDOM. Now time for Architect. Perhaps, neither customer or BA understand Liskov Substitution Principle.
 
Ilja Preuss
author
Posts: 14112
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Murthy Narasimha:
I think CRC cards approach takes us back to the stone-age approach of designing system on paper.


The essence of CRC cards is not the paper, not even the cards - it's the collaboration. The value lies in a team sitting around the table and "roleplaying" the design, handing cards around, making notices etc. For this, physical cards are much more effective than any electronic tool.

In CRC appraoch(in my opinion) therez no traceability.


Correct. They are mainly used to get a first, rough idea of the design. Holding the cards up to date would be of little value, in my opinion.
 
reply
    Bookmark Topic Watch Topic
  • New Topic