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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T14:06:02+00:00 2026-05-19T14:06:02+00:00

All, I am the process of applying design thinking to everyday problems. on the

  • 0

All,

I am the process of applying design thinking to everyday problems. on the process, i need some help on the following. Assume a car renting company such as hertz is needing an application, along with regular data, they need the ability to offer customers offers based on certain criteria.

Criteria are

  1. All listed holidays (not weekends) – get 10% off on hire price
  2. Labor day alone get 15% off on hire price
  3. if taking > 3 days for listed holidays – 20 % off
  4. if taking >3 days on labor day – 25% off
  5. etc – more will come

Now I can think of decorators to start off such as

IVehicleBase
{  
 Props: Make, Model, HirePrice, HireTimePeriodinDays   
}

Concrete classes:

public class FordExplorer : VehicleBase   
{
    public override string Make
    {
        get { return "Ford"; }
    }

    public override string Model
    {
        get { return "Explorer"; }
    }

    public override double HirePrice
    {
        get { return 450; }
    }

    public override int HireTimePeriodinDays
    {
        get { return 1; }
    }
}

Similarly for many other classes (cars).

now how do i decorate the special offers ?

I Can think of a vehicleDecoratorBase, but if the offer is specific to just the holidays then fine (make two concrete implementations for labor / other listed holidays), but we have holidays combined with hireDate which is a domain property of car.

I hope I am making sense here. Any advices pls ?

Cheers

  • 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-19T14:06:02+00:00Added an answer on May 19, 2026 at 2:06 pm

    I would say the rentals, prices, special offers etc. do not belong to the vehicle: these are separate abstraction(s). Especially so as the kinds of offers you list above do not seem to be linked to a specific vehicle model, only to calendar days / length of rental etc.

    So don’t try to add these as decorators to the vehicle. Instead, create a separate class (hierarchy) to deal with them.

    Note that based on your description you have two use cases:

    • the rental agent needs to be able to enumerate all existing offers to the customer like “if you start your rental next Monday, you will get a 10% discount due to this offer, alternatively if you start on Tuesday but extend the rental to 3 days you will get 20% off” etc.
    • the (estimated) price of a concrete rental needs to be calculated taking into account all applicable discounts.

    So on the one hand you should store an instance of each valid offer in a collection, which allows the agent to list them one by one, along with a textual description. (Note that as the offers are most likely stateless, you can have a single shared instance of each.)

    OTOH you need functionality for each offer to decide whether it is applicable for a given concrete rental. This can be implemented within the individual offer classes, then invoked polymorphically by e.g. an offer selector (a special kind of factory), which iterates over the collection of offers and selects the ones for the given rentals (nice, you can immediately reuse the collection of offers for a different purpose!). The applicable offers then in fact operate on the collection of rental charges (i.e. not necessarily directly on the rental object itself), modifying / removing charges as applicable.

    As a side note, if you represent each vehicle model with a separate derived class of IVehicleBase, you would have an awful lot of derived classes in real life, and moreover you would need to add new ones regularly as new models come out and get incorporated into the fleet. And requiring a code change whenever a new vehicle model appears is a maintenance headache in the long run. Of course, if this is just an experimental / toy project, maintenance may not be an issue.

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

Sidebar

Related Questions

how can i process all radio buttons from the page? <input type=radio name=radio_1 value=some
The following code allows you to process all possible pairs of objects (where DoSomething(a,b)
How do I log all process crashes into a file instead of a tty
Is the kernel stack for all process shared or there is a seperate kernel
We all know and love Process.WaitForExit(). Given a pid of a process on a
All instructions to disable Visual Studio hosting process I've found says as follows: Open
We are in the process of encrypting all the SSN columns (had to do
I am in process of getting all hierarchical links from a given link and
I'm in the process of weeding out all hardcoded values in a Java library
We needed to monitor all processes Registry calls/File Sytem calls/Process creations in the system

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.