Coder Social home page Coder Social logo

antikkor's Introduction

Antikkor

This repo is an example (proof of concept) on how to build anti corruption layers for Akka. It aims at segregating the business domain inside the core actors.

The App creates 2 services: Blog and Auth and simulates calls to both of them.

Business domain

Each service actor is using its internal domain model (defined in Model.scala).

Persistence

These core actors are persisted (they extend PersistentActor). However they don't persist their internal core model. Instead the core model is translated in a persistence model (defined in Persistence.scala). It's the job of the EventAdapter to translate between the domain model and the persistence model.

Then their associated PBAkkaSerializer deals with the serialization of the persistence model into Protobuf binary format.

Protocol

Similarly clients using these services do not use their domain model but a protocol (defined in Protocol.scala).

Akka doesn't provide any abstraction to handle the translation between the protocol and the domain model. However it's quite easy to create a proxy actor in charge of the translation between the protocol and the domain model.

This repo took a different approach where the core actors extends (AdapterActor) which intercepts any incoming messages (using the aroundReceive method) and translate them into the domain model before calling the actor's receive method.

antikkor's People

Contributors

btlines avatar

Watchers

 avatar  avatar

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.