Solved

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

Posted on 2008-06-22
3
215 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 12

Accepted Solution

by:
marklorenz earned 250 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 250 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

On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

Question has a verified solution.

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

What is Waterfall Model? Waterfall model is the classic Software Development Life Cycle method practiced in software development process. As the name "waterfall" describes, this development is flowing downwards steadily like waterfall, i.e., procee…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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 antispam), the admini…

752 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