Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1030219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T12:39:58+00:00 2026-05-16T12:39:58+00:00

Date Created a specific example I’m interested in – but there are other bits

  • 0

Date Created a specific example I’m interested in – but there are other bits of data that fall into the same category: data which you’d want to capture about any vaguely important entity.

Where best to do this: business logic (BL) or Data Access layer (DAL)?

Until now I’ve relied on SQL Server’s getdate() to populate the date created for me on insert into the table, but now I’m starting to wonder if I should be doing this more in the BL.

FYI – this has mainly been in web-based systems where you create an object in the BL (based on user input) and fire it off at the DAL – it’s not like I’ve been wanting to refer to the object in memory for ages (so having a “date created” property on the object for use in the BL on creation of the object hasn’t been an issue).

Perhaps there’s a third option – it occurs to me after reading Marr75’s answer that recording it twice might be useful in some senarios (once in both locations). You’d get the benefit of a consisent date/time in the data layer but you’d still have a BL driven value to refer to as well – I guess i’d depend on your use cases. This option isn’t without some risk, though – people might start using the wrong date for the wrong thing.

  • 1 1 Answer
  • 3 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T12:39:59+00:00Added an answer on May 16, 2026 at 12:39 pm

    I’d say: yes.

    Perhaps get into the habit of setting the created and lastaccessed dates in your BL. Then in your DAL, always be checking for nulls in those fields. If they’re null, consider your option: throwing an exception, or just filling in those values at that layer. Kind of a catch-all before insert/update.

    I’ve had the same pattern as you describe in your question. I then was faced with having the application use/consume UTC timestamps, and I figured I’d just move that behaviour to the BL and/or DL classes. Yes, I could’ve used GETUTCDATE(), but it just felt more appropriate to have this logic in the BL/DL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have asked aqbout timezones and date/time before but this is a more specific
I have a method that retrieves all data from a specific column in a
I researched the ItemAdd event and created a class module that follows the example.
I'm trying to work with a timeseries of monthly data. That is, there is
I want to create date with specific format for e.g 03-20-2010 have a format
I have the following table <thead> <tr> <th>Account ID</th> <th>Code</th> <th>Date Created</th> <th>Date Expires</th>
I can get the created date, file size etc for a file using the
How can I shift timezone of Date object created in local timezone to target
I have a data set that resembles this: id product_id size color price created_date
Each logfile is titled based on the date it was created in the format

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.