Skip to content

An implementation of Martin Fowler's "Temporal Object" design pattern

Notifications You must be signed in to change notification settings

coyote/temporal_object

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Temporal Object

This is an implementation of Martin Fowler's Temporal Object Pattern.

It uses abstract time (as implemented by the time_span gem). If you would rather use standard Earth time, you might look into the runt gem.

This gem is implemented as a mixin, so that you can do the following:

require 'temporal_object'
include TemporalObject

Will add instance methods to manipulate TimeLines (and thereby TimeSpans and RelativeTimes) to the including object.

Most of the temporal aspects for Temporal Object are delegated to TimeSpan. The Temporal Object just has any number of TimeSpan statuses.

More information on TimeSpan:

Note: this implementation is quite changed from gem version 0.0.3, where TemporalObjects needed to be created, which pointed to your actual object. Code has been simplified thereby, and is much cleaner.

endorse

About

An implementation of Martin Fowler's "Temporal Object" design pattern

Resources

Stars

Watchers

Forks

Packages

No packages published