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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T02:02:58+00:00 2026-06-14T02:02:58+00:00

I have the following question. Assume we have third party software that send us

  • 0

I have the following question.

Assume we have third party software that send us transaction (atm cards) information in following style:

atm card 4**5048 debited 42$. 231$ Left.

So, I have debited sum, sum left and card no in each transaction.

So I create class

class Transaction {
    private String mCardNo;
    private Double mAmount; // Actually. I dont store money as double, but let it be:)
    private Double mSumLeft;
}

One day second software appears and starts to send the info:

atm card 4**5048 debited 42$: purchase at Apple Store. 231$ Left.

And I think that its awesome to have info about place, where user made a purchase.
There are two options: extend Transaction class or add a new attribute “place”.

One day new software is added and now I have to support 3 types of message!

atm card Visa Classic 4**5048 debited 42$: purchase at Apple Store. 231$ Left.

Oh, God! and Im pretty sure that it will be more than 100 types of messages containing unique numbers of attributes (because I have about 50 now!)

So what is the best way to store additional attributes?

  • 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-14T02:03:01+00:00Added an answer on June 14, 2026 at 2:03 am

    If there’s so much variability in the number of attributes, maybe you should store them in a single class (to avoid an explosion of subclasses) as values in a series of Map attributes and identify them with a String key (say, Map<String, Double>, Map<String, Integer>, etc.)

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

Sidebar

Related Questions

I have the following question on java keystores and keytool. I assume that a
I have a question regarding string modification. Let's assume that we have the following
Assume that I have the following code fragment: operation1(); bw.close(); operation2(); When I call
I have a question regarding primary keys in Relational Databases. Let's assume that I
I have a question about sort defaultdict in python Assume I have the following
I have the following question: Let's assume the code below: ... <h:form id=..> <table>
I have the following question: Assume base class A with method: A& operator+(A& a)
On ASP.NET MVC 3, assume that we have following controller action: public ActionResult Index()
Hopefully, this won't be a silly question. Assume I have the following model: var
Assume that I have the following object public class MyClass { public ReadOnlyDictionary<T, V>

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.