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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:42:38+00:00 2026-05-13T07:42:38+00:00

I’m working on an inherited system which has some design issues which OO Buzzwords

  • 0

I’m working on an inherited system which has some design issues which “OO Buzzwords” frown upon, and some I personally dislike.

It’s a stock and sales handling program for a comic book store.

I have an Article class, which can be any item (Magic cards, toys), and a Publication class that inherits from Article, which represents books and magazines. A Publication has Authors and optionally issue number, while an Article doesn’t.

There’s an Article Editor, which is a GUI to create and modify articles. Since there’s the possibility to load a Publication with an error, and not add a volume number, the interface to work with an article is:

Article a = EntityManager.loadArticle(articleId);
ArticleEditor editor = new ArticleEditor(a);
a = e.getValue();

to allow a to be changed into a Publication, should the need arise.

One of my peeves is that this could be handled more gracefully if it used references, or ar least so it appears to me. My current version uses wraps the last 2 lines’ pattern in a static version, but it still looks ugly because it looks too state-dependent.


The second issue comes with Java’s (and most “enterprise” languages’) lack of multiple dispatch: the EntityManager has a save() method, overloaded for both Articles and Publications. This causes a huge issue if I say, for example:

Article a = EntityManager.loadArticle(articleId);
ArticleEditor editor = new ArticleEditor(a);
a = e.getValue();
EntityManager.save(a);

This is currently “solved” by having the ArticleEditor save changes (which seems wrong).

I’m sure there must be some way to adjust the design to eliminate these issues. (I don’t mind a whole re-write, if need be.)

How can I adjust the design to eliminate these issues?

Edit: Publication has Authors, too, not only Numbers.

  • 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-13T07:42:38+00:00Added an answer on May 13, 2026 at 7:42 am
    1. What’s the problem? It seems fine to me.
    2. Can’t you simulate multiple dispatch in Java using reflection?
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

No related questions found

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.