Skip to content

Commit

Permalink
Merge pull request finos#126 from stephengoldbaum/master
Browse files Browse the repository at this point in the history
Documentation organization and cleanup
  • Loading branch information
stephengoldbaum authored Jan 11, 2023
2 parents 8d903d7 + 07e8ba0 commit 4d95595
Show file tree
Hide file tree
Showing 10 changed files with 377 additions and 55 deletions.
34 changes: 5 additions & 29 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,27 +40,15 @@ Defines a standard format for storing and sharing business logic. A clear set of

> _Morphir’s automated processing helps disseminate information which otherwise may not be understood or shared at all, a useful tool when brining elements of business logic to conversation outside of its immediate audience (i.e developers)._
## FINOS Morphir Resources

[Morphir Resource Centre](https://resources.finos.org/morphir/)
## Documentation
If you want to start using Morphir, start with the [Documentation](docs/).

| Episode | Description |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYx"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/introduction-to-the-morphir-show.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYx">Introduction to the Morphir Showcase</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYz"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/what-morphir-is-with-stephen-gol.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYz">What Morphir is with Stephen Goldbaum</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY2"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/how-morphir-works-with-attila-mi-1.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY2">How Morphir works with Attila Mihaly</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY4"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/why-morphir-is-important-with-co.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY4">Why Morphir is Important – with Colin, James & Stephen</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcw"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/Screenshot-2022-03-02-at-14.35.18.png"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcw">The Benefits & Use Case of Morphir with Jane, Chris & Stephen</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcy"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/how-to-get-involved-closing-pane.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcy">How to get involved – Closing Panel Q&A</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTU5"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/morphir-showcase-full-show.jpg"></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTU5">Morphir Showcase – Full Show</a> |
## Other Resources
[List of media](docs/media.md)

# An ecosystem of innovative features

Supporting the development of your business' needs in an ever-developing ecosystem based on firm standards and the integration of new languages.

Check out [Stephen Goldbaum's Morphir Examples on GitHub](https://github.com/stephengoldbaum/morphir-examples/tree/master/tutorial)

# Further reading
### Further reading

| Introduction & Background | Using Morphir | Applicability |
| :------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------------------- |
Expand All @@ -70,18 +58,6 @@ Check out [Stephen Goldbaum's Morphir Examples on GitHub](https://github.com/ste
| [What's it all about?](./docs/whats_it_about.md) | [Modeling Decision Tables](https://github.com/finos/morphir-examples/tree/master/src/Morphir/Sample/Rules) | |
| [Why we use Functional Programming?](./docs/why_functional_programming.md) | [Modeling for database developers](./docs/modeling/modeling-for-database-developers.md) |

# Development setup

Morphir is a collection of tools. Each tool is in its own repo with its own installation instructions. The main development tools, and the best place to get started, are currently in [Morphir Elm](https://github.com/finos/morphir-elm).

## Usage example

Morphir tools can be used to optimize a wide range of development tasks. For example, Morphir can be used to define and automated development of an entire service. The [Morphir Dapr](https://github.com/finos/morphir-dapr) project is example of this.

Another good use of Morphir is to define shared rules than can be used across heterogeneous systems. This can be useful for initiatives like open-source Reg Tech models that are shared across firms. [Morphir LCR](https://github.com/finos/morphir-examples/tree/main/tests/Morphir/Sample/Reg/LCR) presents a good example of this.

More Morphir examples can be found at [Morphir Examples](https://github.com/finos/morphir-examples/).

## Roadmap

List the roadmap steps; alternatively link the Confluence Wiki page where the project roadmap is published.
Expand Down
13 changes: 13 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Morphir Documentation
The purpose of the document is to provide a detailed explanation of how various Morphir code artefacts work.
It also documents the standard coding practices adopted for the Morphir project.
Finally, it provides a step by step walk-throughs on how various Morphir components are build.

## Who this Guide Designed For
Morphir has different components for different users.

1. **[Morphir User's Guide](users-guide)** - Business users who would like to learn how to use Morphir for modelling business logic.
2. **[Morphir Developer's Guide](developers-guide)** - New joiners to the Morphir project to get up to speed the various building blocks of Morphir.
3. **[Morphir Contributor's Guide](contribution-guide)** - Existing team members intending to improve their abilities on Language Design concepts.


Original file line number Diff line number Diff line change
Expand Up @@ -6,28 +6,28 @@ Given that Apache Spark's data model is an extended relational data model and mo

## Decision Drivers

* Future potential/limitations
* Implementation effort
- Future potential/limitations
- Implementation effort

## Considered Options

* Map to Relational IR first, then to Spark IR
* Map directly to Spark IR
* Map directly to Spark IR, but implement flatten and joins as reusable functions
- Map to Relational IR first, then to Spark IR
- Map directly to Spark IR
- Map directly to Spark IR, but implement flatten and joins as reusable functions

## Decision Outcome

Chosen option: "{option 1}", because {justification. e.g., only option, which meets k.o. criterion decision driver | which resolves force {force} | … | comes out best (see below)}.

### Positive Consequences <!-- optional -->

* {e.g., improvement of quality attribute satisfaction, follow-up decisions required, …}
*
- {e.g., improvement of quality attribute satisfaction, follow-up decisions required, …}
-

### Negative Consequences <!-- optional -->

* {e.g., compromising quality attribute, follow-up decisions required, …}
*
- {e.g., compromising quality attribute, follow-up decisions required, …}
-

## Pros and Cons of the Options <!-- optional -->

Expand All @@ -39,8 +39,8 @@ graph LR
B --> B2C(Spark Backend) --> C[Spark IR]
```

* Good, because it makes the relational mapping reusable
* Bad, because the Relational IR limits the scope of Spark operations we can map to
- Good, because it makes the relational mapping reusable
- Bad, because the Relational IR limits the scope of Spark operations we can map to

### Map directly to Spark IR

Expand All @@ -50,8 +50,8 @@ graph LR
B2C(Spark Backend) --> C[Spark IR]
```

* Good, because we can fully utilize Spark's capabilities to implement all possible Morphir features
* Bad, because we cannot reuse the solutions we come up with for flattening and joins
- Good, because we can fully utilize Spark's capabilities to implement all possible Morphir features
- Bad, because we cannot reuse the solutions we come up with for flattening and joins

### Map directly to Spark IR, but implement flatten and joins as reusable functions

Expand All @@ -63,12 +63,10 @@ graph LR
B2C -.-> J[join]
```

* Good, because we can fully utilize Spark's capabilities to implement all possible Morphir features
* Good, because we can reuse the solutions we come up with for flattening and joins

- Good, because we can fully utilize Spark's capabilities to implement all possible Morphir features
- Good, because we can reuse the solutions we come up with for flattening and joins

## Links <!-- optional -->

* {Link type} {Link to ADR} <!-- example: Refined by [ADR-0005](0005-example.md) -->
*<!-- numbers of links can vary -->

- {Link type} {Link to ADR} <!-- example: Refined by ADR-0005 in 0005-example.md -->
-<!-- numbers of links can vary -->
13 changes: 13 additions & 0 deletions docs/media.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Media About Morphir

If you're interested in learning more about the project, [Morphir Resource Centre](https://resources.finos.org/morphir/), has many links.

| Episode | Description |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYx"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/introduction-to-the-morphir-show.jpg" /></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYx">Introduction to the Morphir Showcase</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYz"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/what-morphir-is-with-stephen-gol.jpg" /></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTYz">What Morphir is with Stephen Goldbaum</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY2"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/how-morphir-works-with-attila-mi-1.jpg" /></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY2">How Morphir works with Attila Mihaly</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY4"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/why-morphir-is-important-with-co.jpg" /></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTY4">Why Morphir is Important – with Colin, James & Stephen</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcw"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/Screenshot-2022-03-02-at-14.35.18.png" /></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcw">The Benefits & Use Case of Morphir with Jane, Chris & Stephen</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcy"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/how-to-get-involved-closing-pane.jpg" /></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTcy">How to get involved – Closing Panel Q&A</a> |
| <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTU5"><img width="250" src="https://resources.finos.org/wp-content/uploads/2022/03/morphir-showcase-full-show.jpg" /></a> | <a href="https://resources.finos.org/znglist/morphir-showcase/?c=cG9zdDoxNTU5">Morphir Showcase – Full Show</a> |
85 changes: 85 additions & 0 deletions docs/users-guide/Custom Attributes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Custom attributes user guide

The contents of this document detail how to structure and load optional "sidecar" files for the purposes of adding custom attributes to Morphir types and values. Custom attributes can assign extra information to business concepts that is otherwise not included in the Morphir IR.

**Contents:**

- [File format and naming convention](#file-format-and-naming-convention)
- [Config file](#config-file)
- [Attribute file](#attribute-file)
- [Loading and updating the attribute files](#loading-and-updating-the-attribute-files)

## File format, and naming convention

To define a custom attribute, we need at least three JSON files.

1. A config file named `attribute.conf.json` that lists the attribute ID's, and maps them to display names.
2. At least one attribute file named `<someAttributeId>.json` in the `attributes`.
3. An IR containing a type definitions

### Config file

```
{
"test-id-1": {
"displayName" : "MS.Sensitivity"
, "entryPoint" : "Morphir.Attribute.Model.Sensitivity.Sensitivity"
, "ir" : "attributes/sensitivity.ir.json"
}
"test-id-2": {
...
}
}
```

The above example is a sample config file structure. The config file should contain key-value pairs in a JSON format, where the key is the attribute name, and the value is the attribute description.
The attribute description should include an entrypoint in the form of an [FQName](https://package.elm-lang.org/packages/finos/morphir-elm/latest/Morphir.IR.FQName) (this is the type describing your custom attribute), a display name, and a path to the IR file containing your type model

### Attribute file

```
{
"Morphir.Reference.Model.Issues.Issue401:bar": {
"MNPI": false,
"PII": true
},
"Morphir.Reference.Model.Issues.Issue401:foo": {
"MNPI": false,
"PII": false
}
}
```

The above example is a sample attribute file structure. The attribute file should be a dictionary in a JSON format, where the keys are Morphir [FQName](https://package.elm-lang.org/packages/finos/morphir-elm/latest/Morphir.IR.FQName)s, and the values are any valid JSON object.

## Loading and updating the attribute files

We currently provide the following APIs.

**_GET /server/attributes/_**
Returns the a JSON file with a very similar structure to the config file, but amended with `data` fields containing the actual custom attribute values, and the `ir` field containing the actual IR instead of a path pointing to it

```
{
"test-id-1": {
"displayName" : <displayName>
, "entryPoint" : <FQName>
, "ir" : "<a Morphir IR>"
, "data" : <custom attribute dictionary>
}
"test-id-2": {
...
}
}
```

**_POST /server/updateattribute/\<yourattributename/>_**

```
{
"nodeId" : <fqname>,
"newAttribute: <JSON>
}
```

Updates the given node with the given new attribute.
78 changes: 78 additions & 0 deletions docs/users-guide/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# Morphir Users' Guide
Morphir's core purpose is to collect and store the vital business logic of an application. To fulfull that goal,
Morphir provides tools to write business logic, visualize and interac with it, and use it to generate useful things.

## Who this Guide Designed For
This guide is for business users, analysts, and developers who want to use Morphir to tap the potential in their business logic.

## Content
1. [Getting Setup](#)
1. [Installation](installation.md)
1. [Editor Setup](editor_setup.md)
1. [The Morphir Tools](command_line_tools.md)
1. [Compile](command_line_tools.md#Compile)
1. [Visualize](command_line_tools.md#Visualize)
1. [Generate](command_line_tools.md#Generate)
<br/>
<br/>

[//]: # (1. [Quick Start]&#40;&#41;)

[//]: # ( 1. [Thinking in Morphir]&#40;&#41;)

[//]: # ( 1. [Describing the Business Domain]&#40;&#41;)

[//]: # ( 1. [Adding Logic]&#40;&#41;)

[//]: # ( 1. [Ensuring Correctness]&#40;&#41;)

[//]: # ( 1. [Testing]&#40;&#41;)

[//]: # ( 1. [Building, Executing, and Deploying]&#40;&#41;)

[//]: # (<br/>)

[//]: # (<br/>)

[//]: # ()
[//]: # (1. [Advanced Topics]&#40;#&#41;)

[//]: # ( 1. [More On Writing Business Logic]&#40;#&#41;)

[//]: # ( 1. [What Makes a Good Model]&#40;#&#41;)

[//]: # ( 1. [Modelling an Application]&#40;#&#41;)

[//]: # ( 1. [Modelling an API]&#40;#&#41;)

[//]: # ( 1. [Modelling the Local State]&#40;#&#41;)

[//]: # ( 1. [Modelling Remote State Dependencies]&#40;#&#41;)

[//]: # ( 1. [Modelling Decision Tables]&#40;#&#41;)

[//]: # ( 1. [Modelling for Database Developers]&#40;#&#41;)

[//]: # ( 1. [Execution]&#40;#&#41;)

[//]: # ( 1. [Complete Examples]&#40;#&#41;)

[//]: # ( 1. [A Simple Walkthrough - The Surfing Board Model]&#40;#&#41;)

[//]: # ( 1. [Overview]&#40;#&#41;)

[//]: # ( 1. [Installing Morphir]&#40;#&#41;)

[//]: # ( 1. [The First Logic]&#40;#&#41;)

[//]: # ( 1. [Generating Code]&#40;#&#41;)

[//]: # ( 1. [Use Case: US LCR]&#40;#&#41;)

[//]: # ( 1. [Modelling LCR]&#40;#&#41;)

[//]: # ( 1. [Modelling Calculations]&#40;#&#41;)

[//]: # ( 1. [Modelling Collection Operations]&#40;#&#41;)

[//]: # ( 1. [Modellng Structures]&#40;#&#41;)
Loading

0 comments on commit 4d95595

Please sign in to comment.