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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T08:04:06+00:00 2026-06-03T08:04:06+00:00

Hierarchy: abstract Package ServerPackage: Package ClientPackage: ServerPackage In terms of EF CF, all three

  • 0

Hierarchy:

  • abstract Package
  • ServerPackage: Package
  • ClientPackage: ServerPackage

In terms of EF CF, all three tables have a one-to-one relationship. Have I selected the right composition to cater to the following scenario?

Scenario:

  • Abstract Package is created by the server upon request with unique Guid.
  • Server creates ServerPackage and sends to client.
  • Client processes ServerPackage and creates a ClientPackage to send back to server.

In other words, as soon as a Package request comes in, a ServerPackage AND a ClientPackage should be created. I am assuming this will not work since I need both packages to be tied to the same abstract Package Id.

Should I be using composition instead of inheritance and force a one-to-one relationship?

Please advise.

  • 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-06-03T08:04:07+00:00Added an answer on June 3, 2026 at 8:04 am

    It will work only if all your packages are same instance => when the server receives request it must immediately create ClientPackage. It cannot create Package because Package is abstract and if it only creates ServerPackage you will not be able to create ClientPackage with the same Id. So it looks like whole your inheritance will be redundant in such scenario.

    If you want to follow your workflow you need composition.

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

Sidebar

Related Questions

I have one main interface and an abstract class implementing all derivable methods (that
I have a hierarchy of tables 3 levels deep (QualificaionType has many QualificationGroups, which
I have a domain object hierarchy with a top level abstract class. In GORM,
In C#, I have a class hierarchy with a couple of abstract base classes
I have a class hierarchy: abstract DomainObject { ... @Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator=SEQ)
I have the following jpa entity inheritance hierarchy: abstract Account ChildminderAccount extends Account ParentAccount
I have the following class hierarchy [BsonKnownTypes(typeof(MoveCommand))] public abstract class Command : ICommand {
I have a hierarchy of worker classes, all of which do some kind of
I have the following hierarchy of classes: abstract MyWindowBase : System.Windows.Window (i.e. the WPF
i have the following (partial) hierarchy: @MappedSuperclass public abstract class PersistentEntity { @Id @GeneratedValue(generator=system-uuid)

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.