From 06af9edfc3d958a45231c449e2b0f7db1f547701 Mon Sep 17 00:00:00 2001 From: Takayuki Sato Date: Tue, 11 Apr 2023 22:48:17 +0900 Subject: [PATCH] doc: removed "What is this?" and added "Concept" in README (#31) --- README.md | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 1f7396c..8fac05a 100644 --- a/README.md +++ b/README.md @@ -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 - -## 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. - ## Supporting Go versions This framework supports Go 1.18 or later. @@ -45,7 +51,7 @@ Now using version go1.20 % ``` - + ## License Copyright (C) 2022-2023 Takayuki Sato @@ -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 -