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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T20:54:47+00:00 2026-05-31T20:54:47+00:00

We have a web application where you can access two services/functions (Buy and Rent).

  • 0

We have a web application where you can access two services/functions (“Buy” and “Rent”). In a first step you have to chosse a ProductCategory from a DropDownList. Not every product category can be bought or rent. We have 5 product categories:

  • A: Buy/Rent
  • B: Buy/Rent
  • C: Buy/Rent
  • D: Only Buy
  • E: Only Rent

How can I design that in a Domain Driven way? In my oppinion the buy/rent property is not a property of the ProductCategory but of the Service itself:

public class Service
{
     public string Name; // Buy or Rent
     public List<ProductType> AllowedTypes; 
}

Edit Second Example:

Both services have a few shared status (e.g. created or finished) but also special status (e.g. “Buy-Status-1”). Is it a good idea to use for both services the same status class? Or better a specialized class per service BuyStatus/RentStatus.

  • 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-31T20:54:49+00:00Added an answer on May 31, 2026 at 8:54 pm

    I think it depends on whether the “buy/rent” vs “only buy/only rent” relation is static or dynamic.

    If the relation is static (once for all) it could be just simpler to have this information directly on the ProductCategory. The less classes the better.

    On the other hand, if the relation is dynamic then making another object responsible for maintaining such knowledge could make it easier to manage the dynamic state (for example, a product could be for rent only for some time and then “buy/rent” for yet some time etc.).

    This follows an oop rule which says that properties are just values and when properties become more complicated (e.g. they change in time and you have to follow all changes) then you move them to separate classes.

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

Sidebar

Related Questions

I have a web application that you can use to import information from another
I have a web application that can load plugins through reflection. It currently uses
I have a delphi (Win32) web application that can run either as a CGI
I have a web application for video upload and play.The administrator can upload and
Currently I have a web application where a user can use dropdown lists to
I have a web application with users and their documents. Each user can have
I have a PHP web application on an intranet that can extract the IP
I have developed a web application and various clients can store records to that
I have an interactive web application powered by jQuery where users can manipulate visual
I want to build a web application where users can register and have a

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.