Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Unit Testing, CRC Cards and MVC
Hi there,

I am new to this group and XP (just a few months) so please forgive me
if my questions are amateur-ish. I am mainly a PHP developer and am
trying to incorporate XP practices into my work so I can have more
order in my life and become more productive. I also love the ideas of
XP. However, I seem to spend 97% of my time reading about XP and design
principals such as N-tier, MVC etc.. and so have become less
productive, but I suppose I need to take one step back to go two steps
forward.

At present I am using the MVC design pattern for my projects. I started
out with User Story cards and tried to write Unit Tests and program
code directly from there. I have no problem writing tests for Models
but can't seem to get my head around testing controllers. Could anyone
enlighten me in this area?

Also, I've decided to flesh out my design again using CRC cards. With
MVC I typically have a Model, View and Controller for every table in
the database. So in an on-line shopping system I have, for example,  a
table for stock and a table for sales. The first CRC card I wrote was
for 'Stock' (mainly because this is the part of the project I am at
now). The responsibilities are along the lines of 'setPrice',
'getStockLevels', 'incrementStock', etc...
Then I went to think of a list of collaborators and the first one that
came to mind was a 'Checkout'. However, checkout is already an *action*
in my Sales controller. My 'Basket' has a controller of it's own and it
seems to make sense that a 'Stock' object would collaborate with a
'Basket' object. It isn't too intuitive that a 'Stock' object would
collaborate with 'Sale' over a 'Checkout' (or rather it seems more
intuitive that a 'Stock' object would collaborate with 'Checkout' over
a 'Sale'). Am I missing something here?
I guess my question is, if using MVC (and therefore basing your objects
on the database tables) does your list of tables represent the
collaborators in the system?
This may seem like a bit of a stupid question I know but I thought I
might as well put it forward since the group is here. In the meantime
I'll be going with this method until I hear more.
Thank you for your time.

Cheers,

Psychie


Report this thread to moderator Post Follow-up to this message
Old Post
Psychie
07-14-06 11:57 PM


Re: Unit Testing, CRC Cards and MVC
Psychie wrote:

> At present I am using the MVC design pattern for my projects.

This is not a particularily ringing endorsement for the sublime quality of
USENET and its patrons, but...

...the best place to ask non-entry-level questions about XP is probably
its mailing list ( extremeprogramming@yahoogroups.com ).

More people like to discuss XP there than like to deflect endless mindless
trolling here. Go figure.

--
Phlip
[url]http://c2.com/cgi/wiki?ZLand[/url] <-- NOT a blog!!!


Report this thread to moderator Post Follow-up to this message
Old Post
Phlip
07-14-06 11:57 PM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Extreme Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 03:21 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.