-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
634a907
commit 9846485
Showing
7 changed files
with
115 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
# Abstraction Layer | ||
The abstraction layer is responsible for abstracting away the implementation of technology to services and external business processes that are consumed and used by the controller. | ||
|
||
## Core Activities | ||
This includes the following core activities. | ||
- Technology specific implementation of services and business functionality presented to the controller. | ||
- Transformation of data to and from application models from technology specific data models. | ||
- Transformation of external exceptions into managed exceptions that can be raised to the controller. | ||
- Event management for long running processes that use event notification when data is received. | ||
|
||
|
||
# Load Behavior | ||
The abstraction is loaded via dependency injection. Abstractions are always instance based and are registered as transient with dependency injection. | ||
|
||
## Dependency Injection | ||
Any external functionality that is needed on the abstraction is injected through constructor-based injection. The following items are generally injected into a controller. | ||
- Logger | ||
- Instances of Technology Specific Functionality | ||
|
||
|
||
## Abstraction Initialization | ||
Abstractions are initialized through the constructor of the abstraction class. | ||
- Subscription to an event's from injected functionality. | ||
- Passing in of configuration information to execute functionality. | ||
- Custom logic that needs to be run when the abstract is loaded. | ||
|
||
|
||
# Communications | ||
The abstraction layer communicates with the controller layer. | ||
|
||
|
||
### Abstraction to Controller Communications. | ||
The abstraction at times will need to notify the controller of an event that has occurred or trigger and agreed upon action. This is accomplished by raising an event that is subscribed to by the controller. | ||
|
||
```mermaid | ||
flowchart LR; | ||
A[Abstraction] -- Raise Event Handler --> C[Control] | ||
``` | ||
|
||
# Event Management | ||
The abstraction is responsible for handling any events that it has subscribed to. Generally, with an abstraction it will only subscribe to events on items consumed through dependency injection. | ||
|
||
# Abstraction Disposal | ||
The abstraction is expected to implement the **IDisposable** interface. The abstraction is responsible for the cleanup of its functionality. The following are common cleanup tasks for an abstraction. | ||
- Unsubscribe to events. | ||
- Call Dispose on injected functionality that support IDisposable. | ||
|
||
[Back to PCA Pattern](/pcapattern.md) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Presentation Control Abstraction for Server Side Blazor | ||
This section provides the background of the **PCA** pattern implementation for server side Blazor. Later editions of this library will support mix mode and WASM based implementations of Blazor. | ||
|
||
|
||
[PCA Pattern Overview](/pcapattern.md) | ||
|
||
[Setup PCA Pattern in Server Side Blazor](/setup.md) | ||
|
||
[Return to PCA Overview](../Readme.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Setup PCA Pattern for Server Side Blazor | ||
In this section we will outline how to setup a blazor server side project to use the PCA pattern. | ||
|
||
## Configuring Program.cs | ||
In the program.cs file we need to register two global services that are used for central management of notification and dialogs in the application. | ||
|
||
Add the following statement before the builder creates the app. So basically before this line **var app = builder.Build();** | ||
``` | ||
builder.Services.AddPCAServices(); | ||
``` | ||
|
||
|
||
## Setup Central Notification and Dialog Management | ||
In the PCA framework there is support to host a central notifcation and dialog support. To do this you update your layout to host the components the execute the central management. Currently we have an example for telerik based components implemented. | ||
|
||
Bellow is a code example of the components implemented in a layout. The components **TelerikCentralNotification** and **TelerikCentralDialog** are added just before the body definition is implemented. | ||
|
||
``` | ||
@using CodeFactory.PCA.Blazor.Tel | ||
@inherits LayoutComponentBase | ||
<TelerikRootComponent> | ||
<div class="page"> | ||
<div class="sidebar"> | ||
<NavMenu /> | ||
</div> | ||
<main> | ||
<div class="top-row px-4"> | ||
<a href="https://learn.microsoft.com/aspnet/core/" target="_blank">About</a> | ||
</div> | ||
<TelerikCentralNotification HorizontalPosition="NotificationHorizontalPosition.Center" VerticalPosition="NotificationVerticalPosition.Bottom"/> | ||
<TelerikCentralDialog/> | ||
<article class="content px-4"> | ||
@Body | ||
</article> | ||
</main> | ||
</div> | ||
<div id="blazor-error-ui"> | ||
An unhandled error has occurred. | ||
<a href="" class="reload">Reload</a> | ||
<a class="dismiss">🗙</a> | ||
</div> | ||
</TelerikRootComponent> | ||
``` | ||
|
||
[Return to Blazor Server for PCA](/Readme.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,4 @@ | ||
# Overview | ||
Placeholder for Documentation | ||
The PCA pattern is defined on a per implementation basis. This section will link you to the documentation for guidance and implementation details. | ||
|
||
[PCA for Blazor Server](/Blazor/Readme.md) |