Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify time management #7

Closed
odrotbohm opened this issue Aug 8, 2014 · 0 comments
Closed

Simplify time management #7

odrotbohm opened this issue Aug 8, 2014 · 0 comments
Assignees
Milestone

Comments

@odrotbohm
Copy link
Member

Simplify TimeService subsystem to the following:

interface TimeService {

  /**
   * Returns the current application time. This will be the time of the system 
   * the application is running on by default but can be adjusted by calling {@link #forward(…)}.
   * …
   */
  LocalDateTime getTime();

  /**
   * Forwards the current time with the given {@link Duration}. Calling the 
   * method multiple times will accumulate durations.
   * …
   */
  void forward(Duration duration);

  /**
   * Returns the current offset between the real time and the virtual one 
   * created by calling {@link #forward(…)}.
   * …
   */
  Duration getOffset();
}
@odrotbohm odrotbohm added this to the 5.4 M1 milestone Aug 8, 2014
@odrotbohm odrotbohm self-assigned this Aug 8, 2014
odrotbohm added a commit that referenced this issue Aug 9, 2014
Removed dependency on JodaTime and switched to Java 8's new DateTime APIs. Introduced Interval value object as the latter is missing the concept of an interval with dedicated start and end date(time).

Pulled in Jadira Usertypes to be able to store Java 8 types in Hibernate directly as the conversion from and into legacy Date instances requires dealing with a default time zone which is cumbersome.

Refactored TimeService to BusinessTime and simplified implementation.
odrotbohm added a commit that referenced this issue Aug 9, 2014
Removed dependency on JodaTime and switched to Java 8's new DateTime APIs. Introduced Interval value object as the latter is missing the concept of an interval with dedicated start and end date(time).

Pulled in Jadira Usertypes to be able to store Java 8 types in Hibernate directly as the conversion from and into legacy Date instances requires dealing with a default time zone which is cumbersome.

Refactored TimeService to BusinessTime and simplified implementation.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant