Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

What method would you suggest to use for creating custom classes in .NET?

Posted on 2008-06-22
3
Medium Priority
?
219 Views
Last Modified: 2013-12-16
Hello All.

Ive been reading a book("The object oriented thought process") on oop and all related concpets. In this book they mention a method for coming up with custom classes. They mention a method which uses "collaboration responsibility cards".  To me, this seems like a rather manual process. Is there another solution that exist to accomplish the same goal(coming up with custom classes) which may be faster to implement?

How do you guys come up with your custom classes?
0
Comment
Question by:appbuilder
3 Comments
 
LVL 12

Accepted Solution

by:
marklorenz earned 1000 total points
ID: 21842131
CRC cards are an older technique and they work for some people. I am with you, I have not had great results with them - I think a lot has to do with how your particular team likes to use them.

There are a number of ways to discover and create your classes. One way is to look for nouns in requirements documents, such as use cases, or during discussions with domain experts.  Another way is to use a UML tool - a free one is ArgoUML; a commercial one is MagicDraw. These help to draw UML class, state, and sequence diagrams, after which you can generate code to your favorite IDE.

The important thing is to find the correct concepts (classes) and allocate them the correct behaviors (methods) for your business domain.
0
 
LVL 7

Assisted Solution

by:joesthebighmoe
joesthebighmoe earned 1000 total points
ID: 21845840
There are many methods and they all have their place. As marklorenz said, sometimes something as basic as noting the nouns can start you off.

However, after the most basic high-level classes have been noted, I believe the best next step is to start walking through user scenarios and figuring out what classes will <b>do</b> what.  This is generally the CRC method, regardless of whether or not you physically produce the cards.  So if actually producing the index cards feels like overkill or too time consuming for a return on investment, then you are probably correct for your current project.  However, this concept of figuring out classes based on needed behavior is still very valid and produces an object design which is more about business (behavior) and less about babysitting a database (data).

I think it also becomes evident that not very user scenario/case/story requires a documented design. Hopefully we can pick out our riskiest or most tricky business logic and start dividing its responsibilities up amongst business objects.

My last recommendation is to think along the lines of behavior that does not change the state of the system. The fact that eventually some data will get stored in a database is usually irrelevant to the business logic that figures out answers. This concept gets referenced in many ways, but often it is referred to as side-affect free programming.  Besides creating code that is easier to test, the approach helps us find our true business objects based on behavior.

Cheers,
Joe
0
 

Author Closing Comment

by:appbuilder
ID: 31469545
Great Job guys. I wish i could have given more point for this question.
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The CRUD Functions CRUD, meaning "Create, Read, Update, Delete (http://en.wikipedia.org/wiki/Create,_read,_update_and_delete)" is a common term to data base developers.  It describes the essential functions of data base table maintenance.  This art…
Introduction This article discusses the Chain of Responsibility pattern, explaining What it is;Why it is; andHow it is At the end of this article, I hope you will be able to describe the use and benefits of Chain of Responsibility.  Backgrou…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

885 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question