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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T10:18:01+00:00 2026-05-24T10:18:01+00:00

I have a scenario where I am designing a system for a retailer. This

  • 0

I have a scenario where I am designing a system for a retailer. This is not a proper live application but just a scenario to check whether my OO design skills are correct and whether I am thinking correctly. I am still learning here. I am doing this in c#.

The scenario is this:

A retailer selling stationary products wants to design a system that will select the best price from his various fixed number of suppliers and make an order from that supplier. For sake of simplicity, I cut the stationary products down to just one product from the same company, which is an XYZ pen. Each of the suppliers will provide a quote for the XYZ pen when asked and the retailer system selects the best price from the various sellers and places an order from that seller.

Approach 1:

  1. Create an abstract class for supplier and an implementation for each supplier.
  2. Each supplier implementation to have a PlaceOrder() method and a cost property.
  3. DataLayer sets the cost property for each supplier implementation.
  4. Create a CheckBestRetailer class that evaluates each implementation for the best price and places an order on the appropriate implementation.

Approach 2:

  1. Create a list of type supplier with Cost property and a PlaceOrder() method.
  2. For each supplier the data layer adds new supplier type to list and sets the cost details it got from the database.
  3. CheckBestRetailer class loops thru that list and evaluates each object for the best price and places an order on the appropriate implementation.

Of the two above, I feel approach 1 is closer to OOP but provided I have a fixed number of suppliers. If the number of suppliers can change depending on data retrieved from database then Approach 2 is more better.

What do you think?

I may not have the best scenario here for testing my OOAD. Would love to have some sample scenarios that I can work with too… if possible with design hints.

Thanks for your time.

  • 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-24T10:18:01+00:00Added an answer on May 24, 2026 at 10:18 am

    Option 1 will be more appropriate if you have different behaviour for each supplier, in this case it seems that going with option 2 is a better choice as its simpler.

    What I usually do when I don’t know how to solve something is:

    • List my requirements: Get best price for an item given a supplier set.
    • Create a list of candidate objects: Supplier, Item, Retailers etc.
    • Draw or layout classes with relationships that I think I make sense
    • When I’m lost I start coding the main classes for the requirement, in this case it would be the Retailers and the GetBestRetailer() method.

    for any of the above it doesn’t matter if you are wrong or not, is kind of a brainstorming to understand better what you have to achieve and what options you find to do it.

    Every time you encounter something that seems to be difficult, I abstract it by either creating a method that returns you the answer you need or by creating a new class if that seems to make better sense.
    As an exercise I try to think that the ‘difficult/complex’ parts will be coded by someone else and by delegating to a method or class I separate that from the part of the problem I’m focusing right now.

    hth

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

Sidebar

Related Questions

I know the question sound somewhat stupid, but i have this scenario. Context I
I have a basic but very important transactional database design question. I am designing
I have this scenario well, i'll let the model explain. public class ScheduleMonthlyPerDayModel {
Scenario: I have an application that pulls data from a SQL database as well
I have in front of me a scenario in which an application needs to
I am designing a Data Entry UI for a WPF application and have a
Basically I have been tasked with tackling the following scenario: When you are designing
I am designing an basic ecommerce application, where I have a form to add
I have scenario where I need to host a web service (WCF) on Azure
I have scenario, I have two update panels on the page (both have update

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.