Class: Hecks::Bluebook::Aggregate

Inherits:
Object
  • Object
show all
Includes:
Behaviour::Aggregate, Construct, IR
Defined in:
lib/hecks/bluebook/aggregate.rb

Overview

A construct like every other: the aggregate carries its own identity and sits in the owner chain between its chapter (a Bluebook) and everything declared on it. The chain is model objects end to end — reference resolution and hecks_fqn both walk it.

THE HOLDING HALF, and nothing else. Every line below restates what language/bluebook/aggregate.bluebook already declares — the field list, said again as readers, again as constructor keywords, and again as an emission. That triplication is what a generator removes; Behaviour::Aggregate carries everything that is NOT derivable from the declaration, so regenerating this file can never be lossy.

PROTOTYPE: hand-written in the shape a generator would emit, to prove the seam before the generator exists. bin/project_model would own this file; behaviour/aggregate.rb stays hand-written.

Instance Attribute Summary collapse

Attributes included from Construct

#hecks_name, #hecks_owner, #hecks_root

Instance Method Summary collapse

Methods included from Behaviour::Aggregate

#add_port, #hecks_separator, #index_declarations, #port, #projected_field, #settle, #storage_name, #value_object

Methods included from Behaviour::Owns

#stamp

Methods included from Behaviour::Indexed

#attribute, #command, #index_attributes, #index_by_hecks_name, #query

Methods included from Behaviour::Identified

#derive_identity

Methods included from IR

extended, included

Methods included from Construct

#hecks_fqn, #hecks_root?, #hecks_separator

Constructor Details

#initialize(name:, description: nil, attributes: [], value_objects: [], commands: [], invariants: [], preconditions: [], projected_fields: [], identified_by: [], lifecycle: nil, entities: [], queries: [], policies: [], ports: [], reference_targets: [], provenance: nil) ⇒ Aggregate

Assigns what the language declares, then hands off to the behaviour's own settle — derived identity, name indexes and owner stamping, none of which the declaration states.



82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# File 'lib/hecks/bluebook/aggregate.rb', line 82

def initialize(name:, description: nil, attributes: [], value_objects: [],
               commands: [], invariants: [], preconditions: [], projected_fields: [], identified_by: [], lifecycle: nil,
               entities: [], queries: [], policies: [], ports: [], reference_targets: [],
               provenance: nil)
  @name              = name.to_s
  @hecks_name        = @name
  @description       = description
  @attributes        = attributes
  @value_objects     = value_objects
  @commands          = commands
  @invariants        = invariants
  @preconditions     = preconditions
  @projected_fields  = projected_fields
  @identified_by     = identified_by
  @lifecycle         = lifecycle
  @entities          = entities
  @queries           = queries
  @policies          = policies
  @ports             = ports
  @reference_targets = reference_targets
  @provenance        = provenance

  settle
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def attributes
  @attributes
end

#commandsObject (readonly)

Returns the value of attribute commands.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def commands
  @commands
end

#descriptionObject (readonly)

Returns the value of attribute description.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def description
  @description
end

#entitiesObject (readonly)

Returns the value of attribute entities.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def entities
  @entities
end

#identified_byObject (readonly)

Returns the value of attribute identified_by.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def identified_by
  @identified_by
end

#identity_headsObject (readonly)

Returns the value of attribute identity_heads.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def identity_heads
  @identity_heads
end

#identity_pathsObject (readonly)

Returns the value of attribute identity_paths.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def identity_paths
  @identity_paths
end

#invariantsObject (readonly)

Returns the value of attribute invariants.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def invariants
  @invariants
end

#lifecycleObject (readonly)

Returns the value of attribute lifecycle.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def lifecycle
  @lifecycle
end

#nameObject (readonly)

Returns the value of attribute name.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def name
  @name
end

#policiesObject (readonly)

Returns the value of attribute policies.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def policies
  @policies
end

#portsObject (readonly)

Returns the value of attribute ports.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def ports
  @ports
end

#preconditionsObject (readonly)

Returns the value of attribute preconditions.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def preconditions
  @preconditions
end

#projected_fieldsObject (readonly)

Returns the value of attribute projected_fields.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def projected_fields
  @projected_fields
end

#provenanceObject (readonly)

Returns the value of attribute provenance.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def provenance
  @provenance
end

#queriesObject (readonly)

Returns the value of attribute queries.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def queries
  @queries
end

#reference_targetsObject (readonly)

Returns the value of attribute reference_targets.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def reference_targets
  @reference_targets
end

#value_objectsObject (readonly)

Returns the value of attribute value_objects.



75
76
77
# File 'lib/hecks/bluebook/aggregate.rb', line 75

def value_objects
  @value_objects
end