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

  • SEARCH
  • Home
  • 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 185127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T15:24:53+00:00 2026-05-11T15:24:53+00:00

Say you have an object which, for the sake of example, we will call

  • 0

Say you have an object which, for the sake of example, we will call the ScoreHotChicksEngine. And say that the ScoreHotChicksEngine’s constructor is expecting to be passed an IDataReader containing property values pertaining to, apparantly, Scoring Hot Chicks for Lonely Geeks.

ScoreChicksEngine(IDataReader reader); 

Ok, here’s what I would like to gather input on…

As a developer would you find it more useful to assume that the reader must be read before being passed into the ScoreChicksEngine

IDataReader = command.ExecuteReader(); reader.Read(); ScoreChicksEngine SCE = new ScoreChicksEngine(reader); 

or would you assume that the engine itself would call that function and possibly deal with the empty values?

IDataReader  = command.ExecuteReader(); ScoreChicksEngine SCE = new ScoreChicksEngine(reader); if (SCE.HasReaderData()) doSomething(); 
  • 1 1 Answer
  • 0 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. 2026-05-11T15:24:54+00:00Added an answer on May 11, 2026 at 3:24 pm

    I’d choose the first method. The second method violates single responsibility principle. I’d also declare the input parameter of the constructor as IDataRecord and not IDataReader. Basically the SCE class constructs itself based on a single record and doesn’t care about a set of records out there.

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

Sidebar

Related Questions

Lets say that I have one component which is doing something with Workbook object
Say I have a simple object which supports implicit casting to System.String public sealed
Lets say I have a single object of type Car which I want to
Say I have a model object 'Person' defined, which has a field called 'Name'.
Let's say I have a WCF service which has a method returning object Person.
I have this huge domain object(say parent) which contains other domain objects. It takes
Say if I have a locationManager(LM) object in activity A, which is my main
Say I have a list of model objects and a controller object which is
Say I have Object A which has a member of type Object B.. and
Lets say I have object Tom which has class Person. Class Person String Name

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.