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 225005
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T19:22:15+00:00 2026-05-11T19:22:15+00:00

I am using the repository pattern and was wondering about what data type I

  • 0

I am using the repository pattern and was wondering about what data type I should return. In my database I have a string that is variable length that needs to be broken up based off of fixed lengths. I was initially thinking of passing out the string and letting the service layer do the parsing based on the lengths of the configured columns. I dont really like the idea of passing a string out of the repository layer, would rather pass out a complete object. Passing out the string seems like not enough separation of responsibility, but having the repository having to go to another method to get how the string should be parsed and doing the parsing seems like too much work for the repo. Any suggestions of what should be the responsibility of the repo and service in this case?

  • 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. Editorial Team
    Editorial Team
    2026-05-11T19:22:15+00:00Added an answer on May 11, 2026 at 7:22 pm

    Since the Repository is supposed to act as a collection of in memory objects, it should return an instance of whatever type of object your application is expecting to deal with. If your application expects a parsed object, you should return that.

    Relying on some service to do the parsing is all a part of your infrastructure anyway. In most Repository implementations you have to do something with your persisted data before you return it, so this is a good thing.

    For example, if your Repository is returning a Domain layer object, but your persistence is using L2S, you might want to map the L2S data to the domain object. You would need to rely on something outside the repository to do this. Call it a service or whatever, you probably don’t want to kluge the repository code with the mapping.

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

Sidebar

Ask A Question

Stats

  • Questions 190k
  • Answers 190k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Well, I've got an example based on the above which… May 12, 2026 at 5:55 pm
  • Editorial Team
    Editorial Team added an answer The main difference is that most API support an imput… May 12, 2026 at 5:55 pm
  • Editorial Team
    Editorial Team added an answer Here's some psuedocode, substituting the common graph theory terms of… May 12, 2026 at 5:55 pm

Related Questions

I am trying to learn Asp.net Mvc so I am trying out this Tutorial.
I am having some issues with using the OrderBy extension method on a LINQ
I am about to start a new project and am deciding what data access
I am using the MVC pattern in ASP.NET using service (BLL) and repository layers

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.