Code Monkey home page Code Monkey logo

cirrus's Introduction

cirrus's People

Contributors

kodraus avatar

Watchers

 avatar  avatar  avatar

cirrus's Issues

Add Command def to Generic args in Process

Adjust the Process type definition as follows:

public class Process<TCommand1, TIn1, TOut1, TCommand2, TIn2, TOut2> : Process<TIn1, TOut1, TIn2, TOut2>, IProcess, IProcessStep<TIn1, TOut2>
        where TCommnd1: IProcessStep<TIn1, TOut1>
        where TIn1 : class, IProcessInput
        where TOut1 : class, IProcessOutput
        where TCommnd2: IProcessStep<TIn2, TOut2>
        where TIn2 : class, IProcessInput
        where TOut2 : class, IProcessOutput

So that we can specify the type of the command to handle the process steps, rather than just specifying the input and output args

Use Expression<Func<>> in Process instead of Func<>

Rather than using Func<> for the threads in Process, use Expression<Func<>> instead and compile when necessary to run. This is so we can serialize the expression and pass along to another node to compile and execute

Clean up Product definition in domain

The current Product definition is pretty nasty. This needs to be tidied up as follows:

  • Remove IProduct, leave property relationships between Product and Variant as coincidental
  • Make all properties on Product protected
  • Implement aggregate classes that expose the appropriate properties on Product depending on the kind of query
  • Adjust the Elasticsearch logic to exclude source properties that aren't exposed by the aggregate

Add Extensible AggregateFactory

Add a factory to convert entities to an appropriate aggregate representation:

public AggregateFactory()
        {
            Mapper.CreateMap<Product, ProductDetails>();
            Mapper.CreateMap<Product, ProductSummary>();
        }

        public T AggregateFromProduct<T>(Product product)
            where T : Product
        {
            return Mapper.Map<T>(product);
        }

Could also use Mapper.DynamicMap<T>. Will also need to verify that the AutoMapper 3.3.0 initialisation using BindingFlags will work on Mono:

Mapper.Initialize(cfg =>
                {
                    cfg.BindingFlags = BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance;
                });

Implement Agents

  • Self-contained blocks of code with an input queue that handle their own failover
  • Allow easy integration with Akka.NET
  • Inject through IoC as lightweight pointers to the queue, so their appropriate Execute methods return immediately

Implement Recursive Variant Matching

Using the following Elasticsearch to support recursive variant matching:

POST products/_search
{
  "query": {
    "filtered": {
      "query": {
        "match_all": {}
      },
      "filter": {
        "term": {
          "_id": "fbe8b40e-0f3d-4dd9-bfc5-26389a1664a9"
        }
      }
    }
  },
  "script_fields": {
    "variants": {
      "script": "variant = _source.variants.find { v -> v.id == match_id } \n variant",
      "params": {
        "match_id": "my id"
      }
    }
  }
}

This needs to be adapted as follows:

  • match_id should be an array of ids
  • The script should recursively run through a for loop over match_id, and update the variant property to be the result of finding the variant with that id

Refactor Process Logic

At the moment things are messy, code is duplicated.

Refactor so common logic is standard, and look into trying to make the design scalable to n steps

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.