Blazor component development experience: Blazor development routines

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

insert image description here

  • 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

insert image description here

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
  • Components
    • complex logic processing
      • page interaction logic
      • dependency injection call
      • Parent component parameter callback
  • Services
    • database operation
    • Global intermediate variables (because Service will only create a singleton in a life cycle, which can be used for parameter callback)

Guess you like

Origin blog.csdn.net/qq_44695769/article/details/132469089