These Enterprise project examples leverage a Layered Seperation Design Pattern for programming (i.e Coding againsta a pattern) rather than Front End Coded Spaghetti.
Key Benefits:
- Tuple Intellisense Design Time intellisense Tuple matching for datafields to Ui properties
- Intuitive UI Logic: The use of tuples for property assignments simplifies the synchronization between UI components and database fields.
- Separation of Concerns: Introducing a 'CRUD' database layer to uncouple UI elements from core business processes.
- Centralized Business Logic: Migrating logic to the CRUD layer fosters a more maintainable and organized code structure.
- Enhanced Testing: Incorporating unit testing to ensure application stability and integrity.
- Cloud Compatibility: Architectural soundness eases the transition to Azure, facilitating mobile application development and codebase sharing.
View is decoupled from Business Login and Database
View = User Interface
UI View
<- View_xxx.cs ->
View via Tuples to POCO
<- CRUD_xxx.cs ->
POCO to EF Db Table
-------------
View to Db Flow
-------------
UI View
Product item = View.Product(int Quantity, string Product);
[View via Tuples to POCO]
CRUD.Product_CreateUpdate (Product item); // Update if Id Assigned
[POCO to Db]
Db Table
EF Db Table
<- CRUD_xxxx.cs ->
EF Table to POCO
<- View_xxxx.cs ->
POCO to Tuples to View
-------------
Db to View Flow
-------------
Product Db Table
CRUD_Product.cs : CRUD.DbtoProduct(long ProductId)
<-- [EFDb to POCO] << Db via EF : CRUD Layer >> -->
VIew_Product.cs : (int Quantity, string Product) View.ProducttoUI (Product item)
<-- [POCOO-> View via Tuples] << UI via Tuples : View Layer>> -->
UI View Updated
Create/Update
Entityframework 6.4 RAD -> EF Visual Editor
At the heart of the project is the CRUD LOB pattern, crafted to bolster the maintainability and scalability of enterprise software.
This strategy is approach aimed at using Winform RAD with Entityframework ORM RAD for Line of Business applications into the future with solid foundations and clear, scalable structure.
Avoiding boilerplate MvvM, Databinding, dependancy injection and allowing for step through debugging.
Note: Graphical Rapid Application Development (RAD) used where possible A pattern for a Frontend and Backend solution to avoid frontend loaded code when using RAD tools.
RAD Tool -> Winform Dot Net 4.8
RAD Tool -> EF Visual Designer for db schema Documentation site.
The DbContext code is tailored for consumption via WebAPI, providing a flexible and scalable approach to data access.
SignalR Enterprise Message Hub, Publish / Subscribe with INotify
The DbContext CRUD operations generate publish/subscribe message bus events via SignalR, enabling real-time communication across the application.
The MVVM pattern can be challenging to debug and adapt due to its complexity and dependency on the UI context. It's often perceived that backend developers prefer not to engage with UI/UX, while frontend designers may lack coding expertise.
In MAUI, a common practice is to write the XAML code for UI design and incorporate data binding directly.
These technologies necessitate a separation between the frontend and backend, employing markup languages like XHTML/XAML and design tools like Figma, Sketch, and Lunacy. Tools for converting designs to code are also available, such as Fantastech.
WPF is an integrated solution for layout, databinding, and cross-platform support, now evolving into WinUI3/MAUI.
With DotNet 4.8, there is a lack of "bindable" options to connect business logic methods in the data source.
The .Net8 WinForms introduces Command Binding features, facilitating a UI-Controller/MVVM approach and enabling more straightforward modernization of WinForms applications.
This new feature streamlines the process of connecting UI elements with business logic, promoting a clear separation between UI and backend code.
public class NotifyPropertyChangeDemo : INotifyPropertyChanged
{
// Event fired when a property changes.
public event PropertyChangedEventHandler? PropertyChanged;
// Backing fields.
private string? _lastName;
private string? _firstName;
// Properties with change notification.
public string? LastName
{
get => _lastName;
set => SetProperty(ref _lastName, value);
}
public string? FirstName
{
get => _firstName;
set => SetProperty(ref _firstName, value);
}
// Method to set the property and notify UI.
protected virtual void SetProperty<T>(ref T backingField, T value, [CallerMemberName] string propertyName = "")
{
if (EqualityComparer<T>.Default.Equals(backingField, value)) return;
backingField = value;
OnPropertyChanged(propertyName);
}
// Method to notify the change of a property.
protected virtual void OnPropertyChanged(string propertyName)
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
}
