The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

object identity and tdd

I am developing a web app in with sql 2000.I am developing the domain model,and i wonder how to TDD an objects identity...Say I have transportpackage class,object of this class need to have a unique identity..what should i do?
Normally,I have an identity column in database for each unique record..but now when I am doing TDD,how to get a unique id(obviously when designing,i cannot touch the database),and test..(some use guid,will that be unique and also should that be then used in database?)
Monday, July 10, 2006
You don't TDD on the Id uniquness while testing the Domain Object.  You might test to make sure the Id is NOT set upon creation.

However, you will test if the Identity is set (not uniqueness) while TDDing on the Data Access layer.

For uniqueness, You will just have faith in your choice of Database.

If your Id is generated by you, you will TDD on the Id generating function.

Tuesday, July 11, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz