First and foremost, please excuse my late delivery of this article and software. I have been going non-stop learning, studying, testing and looking into code generation.
I have posted the third article in the WPF Business Application Series. You can read Part 3 on Code Project here: Business Object Declarative Programming; How To Implement Object Validation & Logging.
This article covers in great detail declarative programming in the business layer. This library allows for codeless validation of business object, codeless character text case correction and entity log entry creation. The article has a Silverlight video that demonstrates the features of the UI.
The above image shows off a very cool feature of the software. Notice that a binding exception is reported along with a broken validation rule in the business layer. This reporting is achieved with no additional code on the developers part. One of my goals was to have unified binding exception and validation rule violation reporting. As you can see from the image this has been achieved and again, without any code.
The following are the bullet points of the BusinessEntityBase class that provides much of the functionality.
- Shared and instance rule management, invocation and broken rule reporting. This includes multiple rule-set capabilities.
- Error reporting at the property and object level. Errors can be extracted as either a string or generic list.
- Is dirty tracking.
- Very simplified method for setter’s to call that encapsulates the validation, event raising and property text case logic.
- Audit message creation based on decorated properties. Message can be a string or collection of property name value pairs.
- Message creation for the entire class. Message can be a string or collection of property name value pairs.
- Change notification for all entity properties.
- Changing notification for all entity properties.
- Intelligent change notification for the IDataErrorInfo.Error property. This permits the Error property to be data bound and always be reported correctly in the UI.
- Rich set of overridable methods that provide the deriving classes flexibility in programming business logic if required.
I have tried some innovative and in some cases original coding techniques (if that is even possible) to achieve the results I was looking for.
I hope that you can learn about using WPF for writing business applications from this series.
Have a great day!
Just a grain of sand on the worlds beaches.