Skip to content

PACTCare/Palantir

Repository files navigation

About

Read me!

This document has the objective to give you an overview of how to use Palantir in your applications.

Flow

Assume you have two users, "Chantal" and "Kevin", who want to communicate through a secured channel. To set up their channel the following has to be done:

  1. Create User "Kevin" and "Chantal"
  2. One user has to send a contact request to the other
  3. The contact request has to be accepted
  4. They can now chat within their own secure channel

You can have a look at the cucumber tests, the example or read the usecase descriptions to see how things are set up codewise.

Usecases

The Messenger follows a usecase orientated approach. The code snippets for every usecase reflect how it is used in Chiota.

cleanarch

More information: http://blog.8thlight.com/uncle-bob/2012/08/13/the-clean-architecture.html

Response Codes

Each response of a usecase inherits from a base response that does contain a response code. You can use the response code to display error messages to your users if needed. For further details see the ResponseCode enumeration.

Entities

While interactors are in place to orchestrate behaviour, entities are supposed to hold it. For details, just take a look at the Entity folder.

You may notice that there currently is not so much business logic in them. That is a thing that will be addressed iteratively, while refactoring the interactors to be pure orchestrators.

Repositories | Cache

For most modern applications it is not possible to be completely clean of outer dependencies. To handle those, repositories have been put in place, to inverse those dependencies.

The messenger module defines two repositories you have to implement yourself (You could start off with the memory implementations for testing, but they will not get you far)

  1. IContactRepository

    There are two options to implement this interface:
    a) Implement the complete interface to use your own logic
    b) Extend the AbstractTangleContactRepository, that already contains basic logic to load contacts from the tangle

  2. ITransactionCache

    This repository caches all transactions received by the messenger. You should implement it in order to significantly speed up your application. In addition cached transactions can not be wiped in a snapshot, which can be useful

Donate

See: https://ecosystem.iota.org/projects/untangle-care