Software Design
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreSoftware Design

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 18th, 2010, 12:07 PM
keelerm keelerm is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2010
Posts: 1 keelerm User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 57 m 45 sec
Reputation Power: 0
Data Mapper and Related Objects

I'm developing a employee record tracking application, and I'm having difficulties wrapping my head around the design approach I should take.

One of the things I'll be tracking is an employee's attendance. The Attendance table in the database has an auto-incrementing primary key, the ID of the employee, the ID of the person recording the issue, the date, and some comments. The ID of the employee is a foreign key to the Employee table, and the recorder's ID is a foreign key to the Users table.

In my code, I'm creating an Attendance object and an Attendance mapper. But I'm not sure exactly about what type of data should be in the Attendance object. Should I be storing the employee ID, or should I be storing an Employee object? Or am I way off base here?

Reply With Quote
  #2  
Old March 18th, 2010, 02:05 PM
Oler1s Oler1s is offline
Contributing User
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jul 2006
Posts: 2,270 Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level)Oler1s User rank is General 11st Grade (Above 100000 Reputation Level) 
Time spent in forums: 1 Month 2 Weeks 4 Days 15 h 34 m 57 sec
Reputation Power: 1735
Quote:
The Attendance table in the database has an auto-incrementing primary key, the ID of the employee, the ID of the person recording the issue, the date, and some comments.
Date only or time included?

Quote:
Should I be storing the employee ID, or should I be storing an Employee object?
You'll need to check the ORM that you use. The documentation should indicate how foreign keys are specified.

Don't guess. Check documentation.
__________________
When you ask a question, be prepared to tell us: what have you tried? If you think you don't need to try anything, we will never be interested in helping you. If you agree with the link, and you refuse to answer that question, you are being a hypocrite.

Need help with broken code? Your question should be like a good bug report: (1) It has the smallest number of steps to reproduce the problem you see (2) It tells us precisely what you expected to see and (3) It tells us what you saw and how it differed from what you expected. We need all three to help you.
Want better answers? Tell us what you Googled for and what steps you took to answer your own question.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreSoftware Design > Data Mapper and Related Objects

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap