C validating business rules

##Attributes Models represent business data in terms of attributes.

Each attribute is like a publicly accessible property of a model.

It has been a couple years since you wrote this article.

Are you still using Web Rule, or have you moved on?

For example, when I insert and update an entity, I repeat the same code for checking that the given value is unique.

Of course you would put the business rules in a logical place - like behind some WCF services, so that they cannot be bypassed.

Do not put database features/limitations in your object's business rules.Examples of these sort of validations are: checking that a value is unique in the database, and checking other entity values.Issue - My problem is that I end up repeating the same code in the Service layer.Over the past couple of days, I’ve pondered the possibility of creating a dynamic business rules engine, meaning one that’s rules and types are conjured up and reconciled at runtime.After reading different articles on the subject matter, my focus was imparted to the Microsoft Dynamic Language Runtime (DLR) and Labmda-based Expression Trees, which represent the factory methods available in the System. Expressions namespace and can be used to construct, query and validate relationally-structured dynamic LINQ lists at runtime using the IQueryable interface.#Purpose FXModel Validation is an Objective-C library that allows to validate data/model/forms easily. So it should work fine both with Core Data or with raw NSObject.

You must have an account to comment. Please register or login here!