Skip to content

Commit

Permalink
doc: removed "What is this?" and added "Concept" in README (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
sttk committed Apr 11, 2023
1 parent 68636aa commit 06af9ed
Showing 1 changed file with 21 additions and 16 deletions.
37 changes: 21 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
# [Sabi][repo-url] [![Go Reference][pkg-dev-img]][pkg-dev-url] [![CI Status][ci-img]][ci-url] [![MIT License][mit-img]][mit-url]

A small framework for Golang applications.
A small framework to separate logics and data accesses for Golang application.

- [What is this?](#what-is-this)
- [Supporting Go versions](#support-go-versions)
- [License](#license)
## Concept

<a name="what-is-this"></a>
## What is this?
Sabi is a small framework for Golang general-purpose application.
This framework separates an application to logic parts and data access parts, and enables to implement each of them independently, then to combine them.

Sabi is a small framework to separate logics and data accesses for Golang applications.
In general, a program consists of procedures and data.
And procedures include data accesses for operating data, and the rest of procedures are logics.
So we can say that a program consists of logics, data accesses and data.

A program consists of procedures and data.
And to operate data, procedures includes data accesses, then the rest of procedures except data accesses are logics.
Therefore, a program consists of logics, data accesses and data.
Furthermore, we often think to separate a application to multiple layers, like controller layer, application logic layer, and database layer.
The logic and data access mentioned in this framework are partially matched those layers, but are not matched in another part.
For example, in the controller layer, there are input data and output data. (In a web application there are request data and response data, and in a command line application there are console input and output.)
Even though all logical processes are moved into the application logic layer, it is remained to transform input data of the controller layer into input data of the application logic layer, and to transform output data of the application logic layer into the output data of the controller layer.
Therefore, there are data accesses in that layer, too.
The data accesses in this framework also includes those data accesses.


## Usage

The usage of this framework is described on the overview in the go package document.

See https://pkg.go.dev/github.com/sttk-go/sabi#pkg-overview.

This package is an application framework which explicitly separates procedures into logics and data accesses as layers.
By using this framework, we can remove codes for data accesses from logic parts, and write only specific codes for each data source (e.g. database, messaging services files, and so on) in data access parts.
Moreover, by separating as layers, applications using this framework can change data sources easily by switching data access parts.

<a name="support-go-versions"></a>
## Supporting Go versions

This framework supports Go 1.18 or later.
Expand All @@ -45,7 +51,7 @@ Now using version go1.20
%
```

<a name="license"></a>

## License

Copyright (C) 2022-2023 Takayuki Sato
Expand All @@ -61,4 +67,3 @@ See the file LICENSE in this distribution for more details.
[ci-url]: https://github.com/sttk-go/sabi/actions
[mit-img]: https://img.shields.io/badge/license-MIT-green.svg
[mit-url]: https://opensource.org/licenses/MIT

0 comments on commit 06af9ed

Please sign in to comment.