Ejemplo n.º 1
0
        static void Main()
        {
            var r = new BuildingBlockRecognizer();
            var p = new DomainProcessor(
                new BoundedContextProcessor(r,
                                            new GroupingProcessor("Commands",
                                                                  new CommandProcessor(r)
                                                                  ),
                                            new GroupingProcessor("Domain",
                                                                  new AggregateProcessor(r),
                                                                  new ValueObjectProcessor(r),
                                                                  new DomainEventProcessor(r),
                                                                  new RepositoryProcessor(r),
                                                                  new ServiceProcessor(r),
                                                                  new FactoryProcessor(r)),
                                            new SagaProcessor(r)
                                            ));

            p.AddAssemblyOfType <Invoice>();
            p.AddAssemblyOfType <OrderCreatedEvent>();
            p.AddAssemblyOfType <Customer>();
            p.AddAssemblyOfType <CustomerStatusChangedEvent>();
            p.AddAssemblyOfType <Shipment>();
            p.AddAssemblyOfType <OrderShippedEvent>();
            p.AddAssemblyOfType <Money>();

            XElement xml = p.Parse();


            //  Console.WriteLine(xml);

            var builder = new DomainSvgBuilder();
            var svg     = builder.CreateDocument().ToString();
            var script  = File.ReadAllText("script.html");

            svg = svg.Insert(svg.IndexOf("</style>") + 8, script);

            // Console.WriteLine(svg);
            File.WriteAllText("a.svg", svg);
        }
Ejemplo n.º 2
0
 public BoundedContextProcessor(BuildingBlockRecognizer recognizer, params IProcessor <Type>[] subProcessors) : base(subProcessors)
 {
     _recognizer = recognizer;
 }
Ejemplo n.º 3
0
 public SagaProcessor(BuildingBlockRecognizer recognizer)
     : base("Saga", recognizer.IsSaga)
 {
     _recognizer = recognizer;
 }
Ejemplo n.º 4
0
 public AggregateProcessor(BuildingBlockRecognizer recognizer)
     : base("Aggregate", recognizer.IsAggregateRoot)
 {
 }
Ejemplo n.º 5
0
 public DomainEventProcessor(BuildingBlockRecognizer recognizer)
     : base("Event", recognizer.IsDomainEvent)
 {
     _recognizer = recognizer;
 }
Ejemplo n.º 6
0
 public CommandProcessor(BuildingBlockRecognizer recognizer)
     : base("Command", recognizer.IsCommand)
 {
     _recognizer = recognizer;
 }