Skip to content

Architecture

Prasad Talasila edited this page Jan 21, 2019 · 6 revisions

Current Module Structure

module-structure

Direction of Dependency

Robert C Martin talks about three concentric layers in software: domain model, use cases and user interface. The innermost layer is domain model. The middle layer is use cases; use cases depend on domain model and domain model does not know anything about use cases. Similarly, user interface is the outer most layer. Use interface knows about uses cases and not the other way round. So, when we port software across different views, we only need to change the user interface.

To map these concepts to Autolabcli, we have the following.

  • missing ---> model
  • lib/model ---> use cases
  • lib/controller + lib/view ---> user interface

We have written use cases without having a coherent domain model. So if we look closely, we will find repetitive functionality among different use cases. So creating a coherent domain model will remove repetitive code from lib/model.

Random Ideas

We can also use Inversion of Control frameworks like electrolyte or scatter or intravenous. But, IoC is not a favorite pattern among JS community, especially since JS is a dynamic language.