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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:33:31+00:00 2026-05-11T17:33:31+00:00

Your job is to design a Project Plan class library which supports the tracking

  • 0

Your job is to design a Project Plan class library which supports the tracking of tasks (similar to how MS Project works). This class library has a Task object (among others).

The Task object has a EstimatedHours (Double), StartDate (DateTime), and EndDate (DateTime) properties, among others. A Task object can have one parent Task, and several children Task objects. The EstimatedHours, StartDate, and EndDate properties of a Task which has children (is a parent) depend on those properties of its immediate children. The parent Task‘s StartDate is the earliest StartDate of its children. The parent Task‘s EndDate is the latest EndDate of its children. The parent Task‘s EstimatedHours is the sum of its children’s EstimatedHours. Therefore, it is invalid to change these properties on a Task which has children.

How would you handle the use case where the EstimatedHours, StartDate, or EndDate are changed on a task which has a parent? (The parent’s properties are a reflection of its children, so any changes to children may require the parent’s properties to be adjusted to reflect the changes appropriately)

One option is to have an event for when each property changes. A parent Task would listen for these events on its immediate children Task objects, and make appropriate changes to its own properties when those events occurred. Is this a good approach, or is there a better way? How would you do it?

Here’s a basic idea of what a Task object might look like:

Public Class Task

  Private mChildren As List(Of Task)

  Private mEndDate As DateTime = DateTime.MinVlue
  Public Property EndDate() As DateTime
    Get
      Return mEndDate 
    End Get
    Set(ByVal value As DateTime)
      mEndDate = value
      'What to do here?
    End Set
  End Property

  Private mEstimatedHours As Double = 0.0
  Public Property EstimatedHours() As Double 
    Get
      Return mEstimatedHours 
    End Get
    Set(ByVal value As Double)
      mEstimatedHours = value
      'What to do here?
    End Set
  End Property

  Private mStartDate As DateTime = DateTime.MinVlue
  Public Property StartDate() As DateTime
    Get
      Return mStartDate 
    End Get
    Set(ByVal value As DateTime)
      mStartDate = value
      'What to do here?
    End Set
  End Property

End Class
  • 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-11T17:33:31+00:00Added an answer on May 11, 2026 at 5:33 pm

    The right approach to solve this problem will be to use Observer Design Pattern. Detailed explaination of implementing Observer pattern is beyond the scope of this discussion. But here are some great links for Observer Pattern. One link is here and another is here.

    http://www.dofactory.com/Patterns/PatternObserver.aspx

    http://en.wikipedia.org/wiki/Observer_pattern

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

Sidebar

Related Questions

Let's say at your job your boss says, That system over there, which has
If your coworker opens (monkeypatches) a class in Ruby and redefines some important functionality
If your server has SSL enabled, and you're using YUI uploader, is it possible
This IS NOT a Homework question! While building my current student database project I
SSIS ETL Design I'm trying to build a ETL job. Below are my primary
I'm sure this question has been asked but it's hard to just google specifically
In may Daily Job i come across this Dilemma : Stable System Vs Better
Greeting's and thanks for your time. I just started a new job building a
Suppose you have some content that is guaranteed to have some value. Your job
After you kick off the export job i.e. : hadoop jar /path/to/hbase-0.20.3.jar export your_table

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.