Programming/Comparisons: Difference between revisions
Jump to navigation
Jump to search
Line 41: | Line 41: | ||
| | | | ||
* Defined by `@page "/<path>"` on each /Page/*.razor page | * Defined by `@page "/<path>"` on each /Page/*.razor page | ||
|- | |||
! Layout | |||
| | |||
* Usually defined in /app/views/layout/application.html.erb | |||
* Usually used in /app/controllers/application_controller.cs, or the root controller of the application | |||
| | |||
* Usually defined in /Shared/MainLayout.razor and /Shared/MainLayout.razor.css | |||
* Usually used in /App.razor | |||
|- | |- | ||
! Permissions/Authentication | ! Permissions/Authentication | ||
Line 60: | Line 68: | ||
** However, these classes are usually wrappers around API calls to other services - C# .NET best practices usually entail a series of micro-services instead of a monolith, meaning the frontend does not directly interact with the database. | ** However, these classes are usually wrappers around API calls to other services - C# .NET best practices usually entail a series of micro-services instead of a monolith, meaning the frontend does not directly interact with the database. | ||
** Since this folder can get pretty big, you'll have to split this up yourself. Some folders I've used are Services, API, Authentication, and Exceptions. | ** Since this folder can get pretty big, you'll have to split this up yourself. Some folders I've used are Services, API, Authentication, and Exceptions. | ||
|- | |||
! Dependency Injection | |||
| | |||
* Rails doesn't really do dependency injection - usually objects are created on demand in the controllers. | |||
| | |||
* Defined in /Startup.cs | |||
* Used as regular parameters in /Data/*.cs | |||
* Used with `@inject <Class> <variable>` in /Pages/*.razor | |||
|- | |- | ||
! JS/CSS | ! JS/CSS | ||
Line 66: | Line 82: | ||
| | | | ||
* /wwwroot/css/*.css | * /wwwroot/css/*.css | ||
* /Pages/Shared/*.razor.css | |||
* Blazor does not use Javascript | * Blazor does not use Javascript | ||
|- | |- |
Revision as of 10:17, 9 August 2021
Frameworks
Ruby on Rails and Blazor
Ruby on Rails and Blazor | |||||
---|---|---|---|---|---|
Ruby on Rails | Blazor | ||||
Language | Ruby | C# | |||
Models |
|
| |||
Views |
|
| |||
Controllers |
|
| |||
Routing |
|
| |||
Layout |
|
| |||
Permissions/Authentication |
|
| |||
Data Services |
|
| |||
Dependency Injection |
|
| |||
JS/CSS |
|
| |||
Asynchronous Calls |
|
|