Skip to content
jmrozanec edited this page May 24, 2016 · 3 revisions

Architecture

cron-utils has currently two main components: parser and descriptor. Using two components, we keep parsing and description decoupled, giving us more flexibility to handle specific cases and a wide range of crons as well as making it extensible.

Model

Proposes a model to represent cron information. Main components are:

  • Cron: object representation of a cron expression.
  • CronDefinition: represents a cron definition. Amount of fields, their meaning and optional fields can be specified. An instance can be created using a builder pattern.

Parser

A builder pattern is used to define custom parsers. A method is provided to retrieve instances of common parsers are defined (unix crontab, cron4j, quartz). The cron parser is responsible for:

  • parsing a cron expression
  • validate the expression matches required constraints (ex.: special characters, number ranges)
  • create a representation of the cron expression

Descriptor

Describes the result from a parsed cron expression. Considers the object model used for cron expression abstraction to provide a description considering a Locale.

Mapper

Provides means to map cron expressions between different cron formats.

Clone this wiki locally