Newsletter sign-up
View all newsletters

Enterprise Java Newsletter
Stay up to date on the latest tutorials and Java community news posted on JavaWorld

JavaWorld Daily Brew

OOPS Class Confusion



I am developing a sample application for learning Oops concepts and have a following scenario which has entities: Task, Reminder.

A Task simply stores the description, status, title etc for it and it is possible to create a reminder for the task i.e. A task may/may not have a reminder set for it (Association would essentially be: 1 task can have 0..1 reminder). Required possible attributes/methods are:

Task
Attributes
-- id
-- title
-- status
-- Description
-- Reminder (object of reminder class) => Not sure whether there will be a Reminder object here?

Methods
-- setReminder() => Not sure whether its the responsibilty of the Task class to set a reminder?

Reminder
Attributes
-- id
-- ReminderDate
-- ReminderTime
-- Task (object of task class) => Not sure whether there will be a Task object here as well?

From Object-Oriented point of view, I am not sure whether the above class description is correct or not. Kindly Suggest.