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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:55:28+00:00 2026-05-27T14:55:28+00:00

Say I want to implement a work place. There are objects of class Employee

  • 0

Say I want to implement a work place. There are objects of class Employee and there is also a class WorkArrangement, which is like a box into which the employees submit their desired shifts for the next week. (The manager then empties the box and uses this information to arrange shifts for the next week).

The problem is, that the code in the class Employee doesn’t know the object box (of class WorkArrangement), so I can’t write a method which says “put your next week shifts in the box”. I can send the box object as a parameter to the constructor of Employee, but it looks like a bad design in the sense of OOP.

So, is it a bad design?
If it is, then what is a possible solution?

  • 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-27T14:55:28+00:00Added an answer on May 27, 2026 at 2:55 pm

    Sounds more like there’s a Box (could just be a list) that takes Shifts, and an Employee has multiple collections of Shifts, desiredShifts and actualShifts.

    The Manager then looks at each employee’s desired shifts, juggles everything around, and assigns actual shifts to each employee, and/or puts them in a shared structure for use in a company calendar.

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

Sidebar

Related Questions

Lets say I want to implement a smart pointer a_ptr which can be compared
I'm trying to understand how locks work. Let's say I want to implement a
Let's say I want to implement a function that is supposed to process an
Say I want to create a card class. and want to have enums for
First off, I want to say there is no use case for this. The
I want to take an object, let's say this object: public class BenchmarkList {
Let's say I want to create a collection class that is thread-safe by default.
Let's say I have a class that implements the IDisposable interface. Something like this:
I want to implement something like a WCF OData provider but using NetTcpBinding instead
Say I have a Listener class. I have class A and class M which

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.