GithubHelp home page GithubHelp logo

ossuminc / riddl Goto Github PK

View Code? Open in Web Editor NEW
19.0 4.0 6.0 19.97 MB

A compiler for the DDD-based design language RIDDL

Home Page: https://riddl.tech/

License: Apache License 2.0

Scala 99.07% DIGITAL Command Language 0.02% HTML 0.16% CSS 0.01% JavaScript 0.74%
scala ddd ddd-architecture ddd-patterns reactive-architecture design design-patterns design-language fastparse

riddl's Issues

Validation Can Be Done In Parallel

Bounded Contexts are very isolated from other constructs. To speed up validation, AST.Context instances could be processed in parallel during validation without harm. The message list will need to become thread safe but there should be little other impact than that.

As an architect, I need information organized by messages, so I can comprehend an event driven system

This is a request to create a new section in the hugo translator's output that organizes information focusing on message types, how they are used, where they are defined, and where in the hierarchy they exist.

Message types are the four DDD types: command, event, query, and result. The documentation for every leaf subdomain should have four pages added, one for each kind of message type. Those pages should list all the messages of their type that are USED by the subdomain (all contexts) but none that are merely accessible by the subdomain. Ideally, that wouldn't happen, but in practice, it will.

Each page contains a list of relevant messages. Each row in that list starts with the name of the message and then a set of tabs:

  • Type - shows the fields of the message, with their brief descriptions if any
  • Defined In - shows the subdomain, context, entity, or other definition in which the message is defined, along with that definition's brief description
  • Used In - shows the places from which this message is used with full path identification, and each path component is a link to the documentation for that definition.
  • Description - Full description of the message as defined in its "described by" type which could be fairly involved with diagrams, etc.

Remove Interaction From AST And All Uses

Interaction was meant to capture an sequence diagram as an interaction between system components as an example of processing, but they are not definitional of even typical processing and therefore more a documentation tool than a system specification.

Sequence diagrams should be generated from definitions made in RIDDL, not the other way around.

Consequently, Interactions should not be part of the language.

Error Highlights

Text entered into RIDDL files that is not syntactically or referentially correct will be highlighted with squiggly red underlines as is common for programming languages.

┆Issue is synchronized with this Jira Story by Unito

Make navigation pane/portal independently scrollable from main body panel.

The left navigation pane currently scrolls together with the main body of the topic you are currently viewing. For example if you navigate to Language -> Conventions you will find that the conventions content is larger than your current screen. If you want to maybe navigate to another topic you cannot scroll to that topic in the navigation pane without scrolling the whole page, losing context of what you were just reading. These two things should be independently scrollable.

┆Issue is synchronized with this Jira Story by Unito

Find Usages

This action, when invoked upon any identifier, looks for all usages of that identifier in the project (not just the current root domain). Usages include identical occurrences of the identifier in strings and comments.

┆Issue is synchronized with this Jira Story by Unito

Finish ReformatTranslator

  • Rename: FormatTranslator → ReformatTranslator
  • Base it on a Folding function, not Folding Trait (avoid inheritance)
  • Make “Include” be honored and implement both sides of “single-file” option

Glossary Language Component

Should we add a glossary language component where we can declare a term and provide a definition? This would be useful in establishing the Ubiquitous Language within a bounded context or domain. If, elsewhere in the spec (maybe a described as block) if a glossary term is used and annotated the output could generate a link to that definition.

A glossary term must be defined within a hierarchy. A term defined within a bounded context or domain has no relevance or meaning outside of the scope where it was defined. If you are in a subdomain the glossary terms of the parent domain still apply - unless expressly overridden. Other relationships (child, sibling) could explicitly reference a definition using that relationship, under the condition that the term is always referenced and cannot be altered unless done where the term was defined.

Implement a SeeAlso feature in RIDDL

When creating a RIDDL specification it may be useful to link a user to another part of the specification. This could be done with a See Also declaration.

Invite users to participate in defining details of a RIDDL model

I am going through the detail of adding definitions for each type, entity, context, domain, command/event/query/result, etc. in a RIDDL file. It made me think, this would be a tremendous opportunity to get users from the business and others involved in the definition of the domain model. It would offload a lot of work from the RIDDL author, and it would serve to get buy in from the true owners of the model.

This is certainly a down the road OSSUM feature. But I think we may need to give some thought on how we could simplify the RIDDL syntax to accommodate this. For example, you declare a new domain as potentially the very first thing in the RIDDL file, however, because of syntax you have to scroll to the end (of a potentially large file) of the file in order to reach a point where you can actually define it. One thing that might ease things a bit on this point is extending the IntelliJ plugin to allow you to collapse blocks of code? Allowing us to include definition blocks outside of the actual RIDDL file (which we have discussed previously) may also help.

A nifty integration for this would be if the validator noticed that something was missing a definition, rather than throwing an error create a JIRA (plug in task management system here) ticket to capture the work. It would be fantastic if the (future) OSSUM feature would allow a conversation (comments/replies) around defined by sections.

It would be handy to include all these defined by blocks in a glossary output - maybe as part of the Hugo site.

Anyway, capturing a thought. Maybe we can discuss further in the future.

Need to establish a convention for naming of types, attributes, fields, and so on in RIDDL files.

I am getting a lot of name conflict warnings with my RIDDL file. Here is the thing, however, I only see it as a conflict within the RIDDL file, but not in actual implementation because the definitions are context sensitive. Here is an example:

[warning] Style: projectx.riddl(249:53): Field 'retailerId' overloads:
Field 'retailerId' at projectx.riddl(66:21),
Field 'retailerId' at projectx.riddl(283:21),
Field 'retailerId' at projectx.riddl(240:21),
Field 'retailerId' at projectx.riddl(326:21),
Field 'retailerId' at projectx.riddl(253:67),
Field 'retailerId' at projectx.riddl(106:21),
Field 'retailerId' at projectx.riddl(257:21)

Each of these is used in either defining a state for another entity, or is an argument for a command/event. It would get noisy and tedious to define each of these uniquely, for example orderBaseRetailerId so that the name was unique across the entire file. This method of naming is a bit redundant because retailerId is used in the definition of the OrderBase state.

Not sure if I am making sense here, but happy to talk it through when it is convenient to do so.

Make TODO a language feature?

Perhaps somewhere (with each page maybe?) in the HUGO output files we need to have a TODO section that would list tasks that need work. These could be included based on a TODO marker in the RIDDL file, or maybe even with a ??? definition. (multiple ways to mark a TODO to include in the output)

dot notation in navigation hierarchy is misleading

For example, if you navigate to Language->Definitional Hierarchy-> Root it appears that Definitional Hierarchy is indented at the level of Interactions before it and Root below it. But there is a pipe in front of it to show navigation context. Styling, however, makes it appear that it is one level down in the hierarchy. Also, the same is true of Root.

┆Issue is synchronized with this Jira Story by Unito

Fix failing GitLab pipelines

For example:

https://yoppworks.slack.com/archives/CSN8D062K/p1643682989256299

which looks like this:

!Screen Shot 2022-02-01 at 2.51.44 PM.PNG|width=672,height=221!

and has this in the pipeline log:

Checking out d9d9daaa as main...

Skipping Git submodules setup
Executing "step_script" stage of the job script
Using docker image sha256:d456c516012bd9badbc8c66c8d5261fc9c3f81d5f637eedaa43b574d43f71dd0 for yoppworks/gitlab-runner-sbt-scala:latest with digest yoppworks/gitlab-runner-sbt-scala@sha256:9801590af7653a9acd9c4ce734d7c5266bb486642c33b0f79a20aed5ab2fd1af ...
Runtime platform                                    arch=amd64 os=linux pid=6 revision=4b9e985a version=14.4.0
FATAL: Command sh not found.                       
Cleaning up project directory and file based variables
ERROR: Job failed: exit code 1

┆Issue is synchronized with this Jira Bug by Unito
┆Attachments: Screen Shot 2022-02-01 at 2.51.44 PM.PNG

Host riddl at riddl.tech

This project has graduated from "nascent" to merely "early". In the spirit of Linus Torvalds "commit early, commit often", this task asks for https://riddl.tech/ to be hosted on Google Cloud as a single VM that:

    • every hour:
      *checks out riddl to a directory.
  • cleans, packages and runs the test suite

  • if successful, starts "hugo -D server" from the examples/target/translator/ReactiveBBQ.riddl

  • makes ReactiveBBQ site (see above) available at riddl.yoppworks.com/examples/rbbq

  • hosts the API docs generated from the last build at https://riddl.yoppworks.com/apidoc

  • hosts the riddl hugo docs at https://riddl.yoppworks.com/doc

This can probably be done most easily by constructing a container that has nginx, git, sbt, scala compiler and a few other things in it.

Remove Scala package named "ossum" from all code

Riddl is its own thing and not a subpart of ossum. When we get to ossum, it will be used, but isn’t logically contained within ossum. Since RIDDL is open source, it needs to be not tied to the idea of Ossum.

This also means the GitLab project should not be buried inside the GitLab Ossum group. It is correct on GitHub (Yoppworks/riddl)

SAGAs need to be able to coordinate function calls

Currently a SAGA expects to be able to coordinate a complex transaction via async messaging to entities (exclusively). SAGAs may also need to coordinate a complex transaction via synchronous calls to external services.

Add A riddlc "shell" command

Add a "shell" command that allows riddlc to be used interactively so that commands and options can be typed in to a prompt and executed that way.

Generate Context Maps From A Domain

The documentation generated by riddlc should create context map diagrams for each domain showing both the contained contexts and the ones they interact with

Revise AST to use Long instead of Location

The use of Location objects in every AST construct is time-consuming and wastes memory allocations. A significant saving could be had if we:

  • Replace "Location" with just a Long (offset in file)
  • Calculate Location only when its needed (method on RiddleNode)
  • Create nodes for input sources (also helps with reflection and

Unfortunately, this is a long, unforgiving, touches everything kind of change at this point, especially in test cases, but worth it in the long run. Without this, every successful parse is penalized for the utility in generating error messages that won't be utilized.

┆Issue is synchronized with this Jira Story by Unito

AST Should Represent Comments Too

Comments are currently ignored by the scala whitespace parser by fastparse. We actually want to keep the comments, as an array of strings, so they may be put out by reformat or otherwise processed by any translator.

We need to:

  • Add Comment(loc: Location, isSingleLine: Boolean, lines: Seq[String]) to AST
  • Change the white space parser to capture both single line (//) and multi-line (/* */) comments
  • Have these things ignored by most translators
  • Have ReformatTranslator regurgitate them.

#include markdown files/snippets

We should be able to author markdown files - or snippets of markdown as a standalone file and #include that file into the RIDDL source. It will make authoring, commenting, and managing those files easier.

┆Issue is synchronized with this Jira Story by Unito

Clean up formatting for Glossary of terms

The primary function of the glossary of terms is to have a quick reference to terms and their definitions. In the current presentation, the type and path columns take up so much real estate that it crowds the definition and makes it hard to read.

Here are a couple of ideas for how we might do this (these are not requirements, but rather ideas to consider)

  1. assign an icon for each of the types (Context, Entity, Function, etc.), move the icon to the first column, and drop the Type text-based column.
  2. move the path under the term in a smaller font; or, maybe make it a popup when you hover over the term. Both could work, but we aren't sure how to pull that off in MD format...

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.