I have been working with a number of clients who have quite complicated lead scoring requirements. These requirements are intended to rank leads by their relative value (of turning into a sales deal that a rep can close) based on constantly changing criteria. Often lead ranking is pretty simple and can be achieved by using custom formula fields (see this salesforce.com community blog post) or Roll-Up summary fields or through appexchange partners. For my situation, neither of the above options really suited my requirements. Thankfully with the force.com platform I can create my own as well.
One of the common requirements of such a solution is the ability to change the rules on a regular basis: add criteria, remove them, change the fields I compare against etc. In other words flexibility is key here. With a quick bit of work I put together screen mock-up to see if it would work within salesforce.com:
As you can see, the mockup looks like it is using some sort of 'language' to let me express my rules in a very flexible manner. To achieve this I am planning on using the Interpreter pattern which will allow the rules to change going forward with very little requirement to modify the custom code.
As we continue to see the Force.com platform extend and customer's really push the creative limits of what is possible I suspect that we will certainly see a continued rise design patterns and best practices to gain a competitive advantage. This is particularly true with customers looking to make the most out salesforce.com in the tough economic climate, and want to maximize their investments. The great thing is that you have a choice of how to achieve this: a rich community of appexchange partners, extensive native functionality, and powerful tools such as Apex and Visualforce for custom solutions.
Ok enough talk; my design is done — I am ready to make the customer successful!