Browsing projects by Tag(s)

Select a tag to browse associated projects and drill deeper into the tag cloud.

Showing page 1 of 1

Simple Rules A simple rules engine which can operate on individual objects or more complex hierarchies of objects. Rules are classified currently by the type they operate on and are indexed by name. The central principle behind the engine is creating Lamda Expressions from method arguments to define ... [More] rules in a way that will hopefully get easier to read as the project evolves. Delegates and lambdas can be used to make it even easier to read, for example, the arguments below: Employee.Rules .Add( "Terminate all hourly employees" ) .When( Employee.is_hourly ) .And( Employee.is_active ) .Then( Employee.terminate );Employee.is_active is actually a static expression property as follows: public static Expression> is_salary { get { return e => e.PayType == PayType.Salary; } }These need to be constructed within your own domain and rely on C# method-group capability for easier readability. Furthermore if your domain objects are defined as partial you can split your data and expression properties into two separate files for readability and so that they are only visible in the area of the domain where applicable. .Add( "Put the order on hold if it is over weight" ) .When(o => o.CalculatedWeight > o.UpperWeightLimit ) .Then(o => o.Status = OrderStatus.OnHold) .Else(o => o.Status = OrderStatus.ReadyToShip);could become: .Add( "Put the order on hold if it is over weight" ) .When( load_is_too_heavy ) .Then( place_order_on_hold ) .Else( mark_order_ready_to_ship ); [Less]

0
 
  0 reviews  |  0 users  |  7,017 lines of code  |  0 current contributors  |  Analyzed 4 days ago
 
 
 
 

Creative Commons License Copyright © 2013 Black Duck Software, Inc. and its contributors, Some Rights Reserved. Unless otherwise marked, this work is licensed under a Creative Commons Attribution 3.0 Unported License . Ohloh ® and the Ohloh logo are trademarks of Black Duck Software, Inc. in the United States and/or other jurisdictions. All other trademarks are the property of their respective holders.