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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T06:24:03+00:00 2026-05-26T06:24:03+00:00

What I want to archieve: Service assembly (project) that holds EntityClasses – pure Data.

  • 0

What I want to archieve:

  • Service assembly (project) that holds EntityClasses – pure Data.
  • GUI assembly that extends those Entities for its own pourposes – Runtime information for GUI.

What I tried:

  • Derivation (Gui defines class ExtendedEntity : Service.BaseEntity)

    seems to be the most common and only practicable way to me, but:

    Converting Service.BaseEntity to ExtendedEntity after retrieving Data from the Service is painful. can ‘workaround’ this by using reflection to generate new ExtendedEntity instances based on base entity instances, but that can’t be the ‘proper’ solution.

  • Partial classes

    is exactly what I’m looking for, except the fact, that it does not work cross-assembly.

I’d greatly appreciate any hints helping me to find a proper & clean solution without reflection cheating =)

  • 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-26T06:24:03+00:00Added an answer on May 26, 2026 at 6:24 am

    Is decompilation an option? If yes you can use e.g. PostSharp or Mono Cecil to rewrite the classes in question and add the there the code you want to have them.
    I am curios why you do not want to use the standard OO approach like derivation. It is definitely not hacking.

    The "cleanest" OO solution is to use aggregation and encapsulate the Entity classes inside objects where you can fully control what you can do with the data and how you want to manipulate or query it. You have reached "heaven" when your aggregation class does not need to expose the internal Entity class anymore because your class is powerful enough to support all necessary operations with the right abstractions.

    If the classes you want to extend are sealed then you need to think hard why the writers of these classes did not want you to extend them.

    Eric Lippert has a nice post about the usages of the sealed keyword.

    …

    Now, I recognize that developers are highly practical people who just
    want to get stuff done. Being able to extend any class is convenient,
    sure. Typical developers say "IS-A-SHMIZ-A, I just want to slap a
    Confusticator into the Froboznicator class". That developer could
    write up a hash table to map one to the other, but then you have to
    worry about when to remove the items, etc, etc, etc — it’s not rocket
    science, but it is work.

    Obviously there is a tradeoff here. The tradeoff is between letting
    developers save a little time by allowing them to treat any old object
    as a property bag on the one hand, and developing a well-designed,
    OOPtacular, fully-featured, robust, secure, predictable, testable
    framework in a reasonable amount of time — and I’m going to lean
    heavily towards the latter. Because you know what? Those same
    developers are going to complain bitterly if the framework we give
    them slows them down because it is half-baked, brittle, insecure, and
    not fully tested!

    …

    Yours,
    Alois Kraus

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

Sidebar

Related Questions

I simply want to create a fairly basic REST service, so that I can
I have this restfull service that I want to be able to call for
I have a MySQL database that I want to archive . What is the
I want to make an Application that only has a NotifyIcon. It doesn't need
I want to test the functionality of an activity that contains a ListFragment ,
I want to build simple SOAP web service. So far I've only worked with
I want to get the string generated by the WCF service, both synchronously and
I want start a service, when a specific bluetoothdevice is connected and stop this
Alright, so here's the dealio: I'm working on a Ruby app that'll take data
I have a windows service where in I want to create a file every

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.