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.





May 11, 2008 at 8:49 am |
Hi Karl
Are you planning on finishing this series of articles ?
I have enjoyed what you have created here so far.
Thanks Terry
May 11, 2008 at 8:53 am |
Terry,
Thank you for you kind comments!
Absolutely! I’m teaching at Code Camp next week and will finish the entire solution as post it on Code Project.
This will be the complete solution everyone wants and I’ll write articles against it.
I had to write a simple (well not so simple) complete application for Code Camp. This brought MVC and BLL, DAL into the picture. A lot of fun.
I’ll post the Code Camp solutions and videos here next week.
Sorry for the delay, as you can image, not a small task.
Cheers,
Karl
September 12, 2008 at 3:23 am |
Karl
I really appreciate the work you did – great presentation app that really shows many aspects.
I am struggeliong with localization of my app – though I did succeed for the UI (binding of labels using StaticResource/DynamicResource) I ask myself how one would ideally work with this for all “server side” localization related stuff, as all your validation messages are in english and hardcoded.
Can you give a hint?
thanks, Klaus