Article directory
foreword
I have been in contact with Blazor for more than a month. After learning about Blazor, I found that it is indeed a good thing. The development speed is too fast. The front-end directly fetches data and ensures security through SSR. But there is a problem, how much pressure the server can withstand. Anyway, a small company with 50 concurrency is not bad.
Blazor development routines
file classification
- wwwroot: web page static file storage location
- Components: components
- Layout: layout
- Page: web page
- Services: Service/Dependency Injection
- Utils: method class
- Models: entity objects
schematic diagram
How to divide the work
- Pages
- parameter control
- Subcomponent initialization
- Routing parameters
- Session get and set
- Subcomponent Communication Mediator
- layout control
- Layout position setting of each component
- parameter control
- Components
- complex logic processing
- page interaction logic
- dependency injection call
- Parent component parameter callback
- complex logic processing
- Services
- database operation
- Global intermediate variables (because Service will only create a singleton in a life cycle, which can be used for parameter callback)