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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T22:26:16+00:00 2026-05-17T22:26:16+00:00

Currently to clone my DTOs I’m implementing IClonable, but this (and the alternatives like

  • 0

Currently to clone my DTOs I’m implementing IClonable, but this (and the alternatives like a clone ctor) mean that I need to add implementation logic into my (otherwise) data-only object.

Is there a better way to clone DTOs, or is including clone logic considered to be OK?

  • 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-17T22:26:16+00:00Added an answer on May 17, 2026 at 10:26 pm

    Such logic is so basic that I think it’s stretching it to call it implementation logic. It may simply make much more sense to clone in this way:

    1. You’re able to call MemberwiseClone to make the shallow copy
    2. The DTO knows everything it needs to clone itself
    3. You’ll not have to create separate objects for this or helpers that depend on reflection

    Not adding cloning logic into DTOs would to me be an obvious example of following architectural patterns too far.

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

Sidebar

Related Questions

I am implementing a netcat clone and currently need a way to run command-line
I am running a gitolite system and I currently clone like this: git clone
I have a repository that is currently using Subversion, but I'd like to use
I'm implementing a LINQ clone in Lua, but that's not too relevant here, and
Currently I am trying to clone this git repo: https://github.com/twilio/OpenVBX into my main repo,
I'm currently trying to clone with the following code: var position = $(this).position(); var
I'm currently using something like c# var myvar = directcast(myarrayofstruct.clone(), mystruc()); vb.net dim myvar
I am currently doing a git svn clone from an svn repository that has
I've currently got a project on google code that I'd like to incorporate into
This is a clone of: https://drupal.stackexchange.com/questions/47865/how-to-make-a-form-that-captures-a-value-from-request (currently no answers) I have been trying to

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.