I need to redesign a 10 year old Product Management Portal and underlying Data-model. There are build of materials as products in the system.

Product managers update pricing frequently for products. The current system uses Textual Boolean expression typed-in a Text-area, using combination of attributes of materials. It results in long lines of && and || expression.

The attributes are also conditional i.e. one attribute depends on other attributes using similar Boolean expression approach. The validity of applicable attributes and price gets calculated using recursive expression evaluation engine, which I believe is slow and not so effective approach.

I want to alter this approach to a more user interactive approach as well as direct and fast calculation of price.

Can any one, who has tackled variable pricing based on combination of multiple price tags and specification attributes, i.e for (height > 10 inch, color = red) price is $50, for (height > 10 inch, color = white) price is $53 and for (height < 10 inch, sleeve = False) price is $23?

It shall also support the different kind of price for applicable tags and attributes i.e. the value can be a multiplier (1.5 times or 0.3 times), the value can be additional cost ($23 or -$10), or the value can have both multiplier and 'to add' components.

I need to be cautious with my design as I will also need to support existing business logic and applications, till all the applications are overhauled and modified around new data-model.

  • One of my first jobs was writing a series of SQL queries to re-jigger Bills of Materials for various configurations of memory devices so that, on a given day, the devices could be built with the cheapest memory chips. The existing MRP system was not capable of this level of granularity. IIRC it took 30 queries to accomplish. – Robert Harvey Mar 27 at 19:46
  • If performance is slow, can you not cache the result until the specification changes? There isn't really enough information here to say how you should proceed, and you don't explain why you need to redesign the system. – George Barwood Mar 27 at 20:30
  • 2
    @GeorgeBarwood reminds me of Joel's blog post about rewriting software joelonsoftware.com/2000/04/06/things-you-should-never-do-part-i – binnyb Mar 27 at 20:41
  • Thank you, George. I can implement cache and design keys to maintain, but at the moment it is not there. Now, since there is need of work on it, I like to overhaul the changes with best possible architecture solution. And, this is the first step in that direction, hence I want to learn from others experiences and wits.. Nonetheless, I intend to use cache, when I start revamping existing desktop application and creating new multi-platform apps. – Hitesh Gaur Mar 27 at 20:43
  • Thanks @binnyb, nice article on rewriting code from scratch. Let me see, if I can avoid that mistake.. :) – Hitesh Gaur Mar 27 at 20:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.