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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T11:38:23+00:00 2026-05-20T11:38:23+00:00

I am not an expert in OOPS and or design patterns. I have come

  • 0

I am not an expert in OOPS and or design patterns.

I have come across this situation: Is a car with a bumper sticker subclass of a car?

If not then how can I add dynamic properties to instance of an object? For example a car, a car with bumper sticker etc.

Not all cars come with a bumper sticker. One can add a bumper sticker and even more than one bumper sticker. I can not implement a sticker with car, afaik, implementing me will force me to add stickers. A bumper sticker on a car is one new property that came into existence after car (object?) was created.

  • 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-20T11:38:23+00:00Added an answer on May 20, 2026 at 11:38 am

    You can use the Decorator Design Pattern for cases like this. It will allow you to “add dynamic properties to instance of an object” which is what you mentioned, you can add any amout of stickers or any other property, in all combinations possible by “decorating” your car class.

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

Sidebar

Related Questions

This is related to this question . I'm not an expert on Linux device
I am not an expert on SQl Server. Is this a valid pattern for
I'm not an expert on this, this is my first foray into creating a
I am not an expert on the internals of C# so this question might
I am not an expert in Objective C and have never submitted an iPhone
not an expert on js but this if-statement still tickles me because I suspect
not an expert on js but this if-statement still tickles me because I suspect
I am not an expert in Java; I am hoping that someone on this
NOTE: I am not an expert, so if you feel this question stupid/lame please
I'm not an expert of jquery and i need help to porting this function

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.