stdio 8fad6c6c35 Update 'backend/README.md' | 7 rokov pred | |
---|---|---|
.. | ||
src | 7 rokov pred | |
.gitignore | 7 rokov pred | |
.goproj | 7 rokov pred | |
Makefile | 7 rokov pred | |
README.md | 7 rokov pred |
Projet structure
Backend -
Core -
Services
usersvc,
imagesvc,
etcsvc
Browser WebHandler Services DataStore
| | | |
|-request------>| | |
| | | |
| |-call-------->| |
| | | |
| | |-query-------->|
| | | |
| | |<---------data-|
| | | |
| |<------return-| |
| | | |
|<-----response-| | |
| | | |
| | | |
Browser WebHandler Services DataStore
(Browser), (WebHandler), (Services), (DataStore)
in MVC we have Model View Controller in same "project" despite this is some what organized it will tie some logic to project, in most projects this is also fine, but ends up later to some recoding in different projects repeat all over again.
Also in regular .NET web projects we have
Persistence:
Proj.Data.Contacts
Model
Proj.Data
ModelRepository
Logic:
Proj.Business
ModelBO
Proj.Web
Controllers
Views
as Views are Processed and sent to browser, Controllers receive request and go to ModelBO retrieving Contacts, it return a view which are processed and sent back to server
The goal:
Create independent contexts:
Persistence:
Pkg.DataStore - persistence
UserService:
Pkg.UserModel
Pkg.UserLogic (service entry point)
ImageService:
Pkg.ImageModel
Pkg.ImageLogic
The caller must be independent from browser, we can create different front ends such as CLI.
Service can require more than one Querier, we can create virtual DB with tables
Logic:
WebProject
ViewModel
Controllers
Views (cshtml)
DataStore data persistence Service performs logic, validation, authorization Communication receives
With independent services we should have a maincore:
//Core will prepare the database, session etc
core.Session();
core.User().Login etc