Comment On The Enterprise Rules Engine

With .NET being the next new thing, a lot of companies have been taking the opportunity to revamp and overhaul their existing applications. Today I'll tell a small part of the story of one such organization (a large retail company) who decided to redesign a large portion of their COM-based order-fulfillment system that had been built using the last new thing, Windows DNA. [expand full text]
« PrevPage 1 | Page 2Next »

Re: The Enterprise Rules Engine

2006-04-14 15:02 • by Bus Raker
first!

Re: The Enterprise Rules Engine

2006-04-14 15:12 • by craig bowes

There is no God!

Re: The Enterprise Rules Engine

2006-04-14 15:13 • by Peter Amstutz
68492 in reply to 68490
First posters should be taken out and shot.



So are "Enterprise Rules Engines" basically just reinventing Prolog?



Re: The Enterprise Rules Engine

2006-04-14 15:17 • by DaveE1
It is too late on a friday to try and make sense of this crap.

I'm going home...

Re: The Enterprise Rules Engine

2006-04-14 15:17 • by Jer
68494 in reply to 68490
No wonder microsoft won't release their source code

Re: The Enterprise Rules Engine

2006-04-14 15:20 • by emurphy
EreRuleAtom[] versus EreRuleAtam ... oy vey.

For bonus points, write a program that auto-translates C# code to ERE-populating code.

Re: The Enterprise Rules Engine

2006-04-14 15:20 • by Bus Raker

The real WTF is that the forum software says '1 Replies'


Haven't they heard of:


caption = (replies = = 1 ? "Reply" : "Replies");


 


 

Re: The Enterprise Rules Engine

2006-04-14 15:24 • by Peter Amstutz
68497 in reply to 68492
And I was going to add to that, "those who do not understand Prolog will reinvent it, poorly."



Person(P)

UnderstandsProlog(P, false) :- and(WillReinventProlog(P), WillDoItBadly(P))



See?  Much clearer.

Re: The Enterprise Rules Engine

2006-04-14 15:27 • by Jackal von ÖRF
They should have used XML. See how much simpler it would have been and you wouldn't need to re-compile the code when you change something:

<ruleset>
  <EreRule>
    <param>OrderRule.CanCancelOrder</param>

    <!-- Order Can Be Canceled When -->
    <EreRuleAtomGroup>

      <!-- Status Is OK -->
      <EreRuleAtomGroup>
        <!-- ( order.OrderStatus != OrderStatus.Approved -->
        <EreRuleAtomGroup>
          <EreRuleAtom>
            <EreRuleAtam>
              <param>order.OrderStatus</param>
              <param>Operands.IsNotEqualTo</param>
              <param>OrderStatus.Approved</param>
            </EreRuleAtam>
          </EreRuleAtom>
        </EreRuleAtomGroup>
        ...
        <!-- && order.OrderStatus != OrderStatus.Canceled -->
        <EreRuleAtomGroup>
          <param>EreRuleAtomGroupType.And</param>
          <EreRuleAtom>
            <EreRuleAtam>
              <param>order.OrderStatus</param>
              <param>Operands.IsNotEqualTo</param>
              <param>OrderStatus.Approved</param>
            </EreRuleAtam>
          </EreRuleAtom>
        </EreRuleAtomGroup>
      </EreRuleAtomGroup>

      <!-- User Is Authorized  -->
      <EreRuleAtomGroup>
        <!--   || ( IsAuthorizedForOperation (
                  currentUser,
                  Operations.LateStatusCancel ) )
        -->
        <EreRuleAtomGroup>
          <param>EreRuleAtomGroupType.Or</param>
          <EreRuleAtom>
            <EreRuleAtam>
              <param>IsAuthorizedForOperation(
                  currentUser,
                  Operations.LateStatusCancel)</param>
              <param>Operands.IsEqualTo</param>
              <param>true</param>
            </EreRuleAtam>
          </EreRuleAtom>
        </EreRuleAtomGroup>
      </EreRuleAtomGroup>
    </EreRuleAtomGroup>
  </EreRule>
</ruleset>


Re: The Enterprise Rules Engine

2006-04-14 15:27 • by sammybaby
68499 in reply to 68497

Anonymous:
And I was going to add to that, "those who do not understand Prolog will reinvent it, poorly."

Person(P)
UnderstandsProlog(P, false) :- and(WillReinventProlog(P), WillDoItBadly(P))

See?  Much clearer.


I was thinking of ML, but I think Prolog is actually better.

Re: The Enterprise Rules Engine

2006-04-14 15:28 • by VGR
There's a name for this:  Second System Syndrome.



For those who haven't heard of it, I offer this:



http://en.wikipedia.org/wiki/Second_system_syndrome



Funny how creating a pseudo-language to "save" coding effort always seems to end up creating more work than it saves.

Re: The Enterprise Rules Engine

2006-04-14 15:29 • by USS Enterprisey
68501 in reply to 68490
I like how the comment contains actual working code that pretty much does the same thing (but in a way that can be read and comprehended) in order to explain what the Enterprise Rules Engine is actually doing (which is obfuscated and enterprisey).

Re: The Enterprise Rules Engine

2006-04-14 15:36 • by TomCo
68502 in reply to 68496

[I]


EnterpriseReply enterpriseReply = EnterpriseReply.Load(Reply.NumberOfReplies); // 0 to infinity and beyond! Negative? Never!!


try {
  if (EnterpriseReply.ObjectNotInitializedProperly) { // huh?
    enterpriseReply.Result = 'file not found';
  }
  else {
   
if (enterpriseReply.NumberOfReplies==EnterpriseReply.OneReplyOnly)) // 1
    {

      enterpriseReply.Result
= EnterpriseReply.MultipleReplies; // "Replies"
    }
    else {
      enterpriseReply.Result = EnterpriseReply.SingleReply; // "Reply"
    }
  }
}
catch { // me if u can }
finally { E
nterpriseReply.Unload(enterpriseReply); }


return ('moose');


[<:o)] It's a *good* friday after all!

Re: The Enterprise Rules Engine

2006-04-14 15:39 • by Pyromancer
68503 in reply to 68500
.NET 3.0 will certainly include exec method to execute code written inside XML strings

Re: The Enterprise Rules Engine

2006-04-14 15:43 • by twks
They need to scrap all of the code and just compile the comments to make a program that is more readable and maintainable.

Re: The Enterprise Rules Engine

2006-04-14 15:43 • by Gene Wirchenko
Alex Papadimoulis:
One of the lessons learned from the years spent building the existing applications was that complex systems with a lot of business rules require a lot of programming code. Unfortunately, the takeaway from that lesson was not that it was essential to organize such code so that it's easier to maintain, but that they should instead invent some way to write a lot of code without hard-coding their code. This is where the Enterprise Rules Engine came in.


ERE: because what we had EREnow was better.


/////////////////////////////

// CanCancelOrder
/////////////////////////////
// Determines whether or not an order is eligible
// for being canceled:
// (
// ( order.OrderStatus != OrderStatus.Approved
// && order.OrderStatus != OrderStatus.Packed
// && order.OrderStatus != OrderStatus.Billed
// && order.OrderStatus != OrderStatus.Shipped
// && order.OrderStatus != OrderStatus.Canceled
// )
// || ( IsAuthorizedForOperation (
// currentUser,
// Operations.LateStatusCancel ) )
// )
/////////////////////////////

_ruleset.AddRule
(
new EreRule
(
OrderRule.CanCancelOrder,

// -- Order Can Be Canceled When -- //
new EreRuleAtomGroup[]
{
// -- Status Is OK -- //
new EreRuleAtomGroup[]
{
// ( order.OrderStatus != OrderStatus.Approved
new EreRuleAtomGroup
(
new EreRuleAtom[]
{
new EreRuleAtam
(
order.OrderStatus,
Operands.IsNotEqualTo,
OrderStatus.Approved
)
}
),
...
// && order.OrderStatus != OrderStatus.Canceled
new EreRuleAtomGroup
(
EreRuleAtomGroupType.And,
new EreRuleAtom[]
{
new EreRuleAtam
(
order.OrderStatus,
Operands.IsNotEqualTo,
OrderStatus.Approved
)
}
)
},

// -- User Is Authorized -- //
new EreRuleAtomGroup[]
{
// || ( IsAuthorizedForOperation (
// currentUser,
// Operations.LateStatusCancel ) )
new EreRuleAtomGroup
(
EreRuleAtomGroupType.Or,
new EreRuleAtom[]
{
new EreRuleAtam
(
IsAuthorizedForOperation(
currentUser,
Operations.LateStatusCancel),
Operands.IsEqualTo,
true
)
}
)
}
}
)
)

And to check if an order can be canceled, simply, write IsRuleValid(OrderRule.CanCancelOrder) ...


Wow!  This must be the latest thing!  Just look at all those "new"s.

Good comments!  I can read the comments and understand what is supposed to be done.  Too bad that is not true of the code^Wdatabase contents.

Sincerely,

Gene Wirchenko

Re: The Enterprise Rules Engine

2006-04-14 15:45 • by mrprogguy

I'd like to say I've never worked in a place where something like that was tried.


'Nuff said.


Still, I've always thought a decent way to get around this would be to write the mainstream code in something like C#, and then make callouts to something like JavaScript (or any interpreted language) for certain kinds of rules, which could be replaced as needed without requiring compilation (except in extreme cases).


It worked quite well for a food kiosk I did in which I had to map a single store PLU code for "sauce" into the correct image for a "what condiments do you want?" page.  The script mapped sandwich PLUs to appropriate sauce pseudo-PLUs, and returned the correct image index for the sandwich (so your Big M@c showed special sauce, and your Filet-o-F1sh showed tartar sauce, even though the lazy-ass store managers would code the same PLU for both into the point-of-sale system).  When a new sandwich came along, I just rewrote the script and propped it to the kiosks, without having to restart anything. 


In an enterprise environment, the script would just get JIT'd into place the first time, and remain resident thereafter, without the performance hit.

Re: The Enterprise Rules Engine

2006-04-14 15:47 • by Gene Wirchenko
68507 in reply to 68500
VGR:
There's a name for this:  Second System Syndrome.



For those who haven't heard of it, I offer this:



http://en.wikipedia.org/wiki/Second_system_syndrome


It just occurred to me that this might explain .Net.

Funny how creating a pseudo-language to "save" coding effort always seems to end up creating more work than it saves.


You can leave off  "pseudo-" and still have a correct statement.

Sincerely,

Gene Wirchenko

Re: The Enterprise Rules Engine

2006-04-14 15:55 • by kipthegreat
Alex Papadimoulis:
  new EreRule

new EreRuleAtomGroup[]
new EreRuleAtomGroup[]
new EreRuleAtomGroup
new EreRuleAtom[]
new EreRuleAtam


So... is this like Old English for-
  new BeforeRule
new BeforeRuleAtomGroup[]
new BeforeRuleAtomGroup[]
new BeforeRuleAtomGroup
new BeforeRuleAtom[]
new BeforeRuleAtam

??

Also, is the last one really supposed to be spelled "Atam" ?

Re: The Enterprise Rules Engine

2006-04-14 15:56 • by Alex Papadimoulis
68509 in reply to 68495

emurphy:
EreRuleAtom[] versus EreRuleAtam ... oy vey.


Whoops -- obfuscation typo! Fixed it.

Re: The Enterprise Rules Engine

2006-04-14 16:09 • by grayrest

I don't see a huge problem with the underlying concept, the ability to modify the business rules of something without recompiling, perhaps without shutting the program down. I'd lean towards using IronPython for the 'rules engine'. Native code for infrastructure, IP for scripting. Of course, I'd rather do Python for everything and use C# if I really needed speed. Guess that's why I'm not enterprise.



PS: Your design mode forum posting system is my daily wtf.

Re: The Enterprise Rules Engine

2006-04-14 16:14 • by Goplat
68512 in reply to 68496
Bus Raker:

The real WTF is that the forum software says '1 Replies'


Haven't they heard of:


caption = (replies = = 1 ? "Reply" : "Replies");


 




Obviously you still understood that there was one reply even though
the plural was used. Why add extra complexity to the software for no
benefit?


For some programs, choosing between singular/plural nouns
automatically can actually be detrimental because it makes the output
harder to be parsed by other programs.


Re: The Enterprise Rules Engine

2006-04-14 16:27 • by Volmarias
68514 in reply to 68499
-----
_ And I was going to add to that, "those who do not understand Prolog will reinvent it, poorly."
_
_ Person(P)
_ UnderstandsProlog(P, false) :- and(WillReinventProlog(P), WillDoItBadly(P))
_
_ See? Much clearer.
-----
I was thinking of ML, but I think Prolog is actually better.
---
I was thinking Lisp myself.

Attention CommunityServer: Get out of my community. You're obviously bigoted against Opera browser.

Re: The Enterprise Rules Engine

2006-04-14 16:31 • by Gene Wirchenko
68515 in reply to 68512
Goplat:
Bus Raker:
The real WTF is that the forum software says '1 Replies'

Haven't they heard of:



caption = (replies = = 1 ? "Reply" : "Replies");




Obviously you still understood that there was one reply even though
the plural was used. Why add extra complexity to the software for no
benefit?

1) Why should I have to do error recovery just to read a message?

2) If the output is wrong/sloppy, what else might be wrong/sloppy?


For some programs, choosing between singular/plural nouns
automatically can actually be detrimental because it makes the output
harder to be parsed by other programs.

OK, fess up, folks!  Who uses a program to read this forum for them?  "Once upon a time, a ..."

Sincerely,

Gene Wirchenko

Re: The Enterprise Rules Engine

2006-04-14 16:37 • by Bus Raker
68516 in reply to 68512
Goplat:
Bus Raker:

The real WTF is that the forum software says '1 Replies'


Haven't they heard of:


caption = (replies = = 1 ? "Reply" : "Replies");


 



Obviously you still understood that there was one reply even though the plural was used. Why add extra complexity to the software for no benefit?


For some programs, choosing between singular/plural nouns automatically can actually be detrimental because it makes the output harder to be parsed by other programs.



Guess you weren't a computer science / English literature double major.  It is true the English language isn't very efficient.  I definitely recommend inventing a new language .. we'll call it English Sharp, without pluralilty and conjugation.  While we're at it we can stop using this primitive base 10 crap, with factors of 2 and 5 and move on to the more efficient world of base 12 with factors of 2,3 and 4.  The combined paper savings of calculating 1/3 = 4 rather than 1/3 - 3.3333 will save at least 10% of our national forests. 

Re: The Enterprise Rules Engine

2006-04-14 16:39 • by Jeff S
68517 in reply to 68515
I'm sure there is a database back end for this app .... so I have to ask: would it be too simple and obvious to put a "IsCancellable" bit column in the OrderStatus table?

Probably.

Re: The Enterprise Rules Engine

2006-04-14 16:41 • by Bus Raker
68518 in reply to 68516
Bus Raker:
Goplat:
Bus Raker:

The real WTF is that the forum software says '1 Replies'


Haven't they heard of:


caption = (replies = = 1 ? "Reply" : "Replies");


 



Obviously you still understood that there was one reply even though the plural was used. Why add extra complexity to the software for no benefit?


For some programs, choosing between singular/plural nouns automatically can actually be detrimental because it makes the output harder to be parsed by other programs.



Guess you weren't a computer science / English literature double major.  It is true the English language isn't very efficient.  I definitely recommend inventing a new language .. we'll call it English Sharp, without pluralilty and conjugation.  While we're at it we can stop using this primitive base 10 crap, with factors of 2 and 5 and move on to the more efficient world of base 12 with factors of 2,3 and 4.  The combined paper savings of calculating 1/3 = 4 rather than 1/3 - 3.3333 will save at least 10% of our national forests. 



I'd better go home ... 1/3 = .3333_


 

Re: The Enterprise Rules Engine

2006-04-14 16:43 • by makomk
68519 in reply to 68501
Anonymous:
I like how the comment contains actual working code that pretty much does the same thing (but in a way that can be read and comprehended) in order to explain what the Enterprise Rules Engine is actually doing (which is obfuscated and enterprisey).



Yep - I was just thinking that. Basically, they should've written the rules using some terse-but-readable representation like that and coded a parser to read in the rules. (But then it wouldn't be on The Daily WTF...)

Re: The Enterprise Rules Engine

2006-04-14 16:46 • by kipthegreat
68520 in reply to 68512
Goplat:
Bus Raker:

The real WTF is that the forum software says '1 Replies'


Haven't they heard of:


caption = (replies = = 1 ? "Reply" : "Replies");


 




Obviously you still understood that there was one reply even though
the plural was used. Why add extra complexity to the software for no
benefit?


For some programs, choosing between singular/plural nouns
automatically can actually be detrimental because it makes the output
harder to be parsed by other programs.



Choosing singular/plural nouns makes users less inclined to think that the program was written by retarded people.  Besides, it's not like it's hard to do.


I use this handy Java code in programs where I do this often:

  /**
   * Returns pluralized item.
   * pluralize(1, "fung", "us", "i"); returns "1 fungus", whereas
   * pluralize(5, "fung", "us", "i"); returns "5 fungi"
   */
  public static String pluralize(int count, String item, String singularSuf, String pluralSuf) {
    return Integer.toString(count) + " " + item + ((count == 1) ? singularSuf : pluralSuf);
  }
  /**

   * Pluralizes a term that you only need to add an "s" to.

   */

  public static String pluralize(int count, String item) {

    return pluralize(count, item, "", "s");

  }

 




And I also have my much simpler PHP version that will work with integers or floating-point numbers, and doesn't require overloading:

function pluralize($count, $item, $singular_suf='', $plural_suf='s') {
  return "$count $item" . ($count == 1 ? $singular_suf : $plural_suf);
}


It would be trivial to internationalize this as well (well, at least to a language that uses a suffix.. there probably are languages that don't do pluralization that way.. but I've never had to code to support one so I don't know).

Re: The Enterprise Rules Engine

2006-04-14 16:47 • by makomk
68521 in reply to 68519
makomk:
Anonymous:
I like how the comment contains actual working code that pretty much does the same thing (but in a way that can be read and comprehended) in order to explain what the Enterprise Rules Engine is actually doing (which is obfuscated and enterprisey).



Yep - I was just thinking that. Basically, they should've written the rules using some terse-but-readable representation like that and coded a parser to read in the rules. (But then it wouldn't be on The Daily WTF...)


Gah - was playing with the test forum (which doesn't need me to pretend to be using IE anymore) and forgot to change my Konqueror settings back, hence the mangled post.

Re: The Enterprise Rules Engine

2006-04-14 16:49 • by kipthegreat
68522 in reply to 68518
Bus Raker:
Bus Raker:
Goplat:
Bus Raker:

The real WTF is that the forum software says '1 Replies'


Haven't they heard of:


caption = (replies = = 1 ? "Reply" : "Replies");


 



Obviously you still understood that there was one reply even though the plural was used. Why add extra complexity to the software for no benefit?


For some programs, choosing between singular/plural nouns automatically can actually be detrimental because it makes the output harder to be parsed by other programs.



Guess you weren't a computer science / English literature double major.  It is true the English language isn't very efficient.  I definitely recommend inventing a new language .. we'll call it English Sharp, without pluralilty and conjugation.  While we're at it we can stop using this primitive base 10 crap, with factors of 2 and 5 and move on to the more efficient world of base 12 with factors of 2,3 and 4.  The combined paper savings of calculating 1/3 = 4 rather than 1/3 - 3.3333 will save at least 10% of our national forests. 



I'd better go home ... 1/3 = .3333_


 

In base-12, 1/3 would be 0.4.

Re: The Enterprise Rules Engine

2006-04-14 16:50 • by Zapper
68523 in reply to 68517
IsCancellable would be a calculated field from Order Status which is a WTF in live a database

Re: The Enterprise Rules Engine

2006-04-14 16:59 • by mol
68525 in reply to 68520
It wouldn't. There are much more complex plural forms in other languages. See http://translate.sourceforge.net/wiki/l10n/pluralforms for details.

Re: The Enterprise Rules Engine

2006-04-14 17:01 • by mol
68526 in reply to 68520
kipthegreat:


I use this handy Java code in programs where I do this often:

  /**
   * Returns pluralized item.
   * pluralize(1, "fung", "us", "i"); returns "1 fungus", whereas
   * pluralize(5, "fung", "us", "i"); returns "5 fungi"
   */
  public static String pluralize(int count, String item, String singularSuf, String pluralSuf) {
    return Integer.toString(count) + " " + item + ((count == 1) ? singularSuf : pluralSuf);
  }
  /**
   * Pluralizes a term that you only need to add an "s" to.
   */
  public static String pluralize(int count, String item) {
    return pluralize(count, item, "", "s");
  }
 



And I also have my much simpler PHP version that will work with integers or floating-point numbers, and doesn't require overloading:

function pluralize($count, $item, $singular_suf='', $plural_suf='s') {
  return "$count $item" . ($count == 1 ? $singular_suf : $plural_suf);
}


It would be trivial to internationalize this as well (well, at least to a language that uses a suffix.. there probably are languages that don't do pluralization that way.. but I've never had to code to support one so I don't know).

It wouldn't. There are much more complex plural forms in other languages. See http://translate.sourceforge.net/wiki/l10n/pluralforms for details.

Re: The Enterprise Rules Engine

2006-04-14 17:01 • by Cooper
68527 in reply to 68512
Goplat:

Why add extra complexity to the software for no
benefit?

Absolutely right on on this, unless one cares about proper language usage in a UI.  Since real men don't use UIs, we definitely should never develop them properly.


For some programs, choosing between singular/plural nouns
automatically can actually be detrimental because it makes the output
harder to be parsed by other programs.



Of course.  And since this forum software output is clearly meant to be parsed by another program, rather than displayed, you are right again.

What do you do, code screen scrapers for a living??

Re: The Enterprise Rules Engine

2006-04-14 17:13 • by warmachine
The pseudo-language is so complex, that the interpreter is likely to have a bug. A rule change will likely require a redeployment anyway.

Worse, the author must be some kind of masochist. Database-driven rules can be useful as they can be edited by a depertment manager or business analyst who cares about the application. This pseudo-language is so complex that another programmer would struggle to edit it. The original programmer would have to do it. For ever.

Re: The Enterprise Rules Engine

2006-04-14 17:14 • by Gene Wirchenko
68530 in reply to 68520
kipthegreat:
It would be trivial to internationalize this as well (well, at least to a language that uses a suffix.. there probably are languages that don't do pluralization that way.. but I've never had to code to support one so I don't know).


Apparently, the difficulties can be considerable: http://search.cpan.org/dist/Locale-Maketext/lib/Locale/Maketext/TPJ13.pod

Sincerely,

Gene Wirchenko

Re: The Enterprise Rules Engine

2006-04-14 17:20 • by 1137
68531 in reply to 68514
I'd like to see that in Intercal language :)

Re: The Enterprise Rules Engine

2006-04-14 17:55 • by Jeff S
68534 in reply to 68523
Anonymous:
IsCancellable would be a calculated field from Order Status which is a WTF in live a database


I think we have the first "WTF comment of the day!" award.  Congratulations!

IsCancellable is an *attribute* of an Order Status.   If you have a table defining your order statuses (hopefully, if you are using foreign keys and all of them other fancy database features) then that is where it belongs.  Not in your code, not in an XML file, not anywhere else.

see:

http://weblogs.sqlteam.com/jeffs/archive/2006/02/10/9002.aspx

where I present an ingenious new idea of actually storing data in your *tables* as opposed to embedding it in your code.

Re: The Enterprise Rules Engine

2006-04-14 17:56 • by BiggBru

Joel on SnagIt:


"You thought SnagIt was just a dinky screen capture utility? Boy, are you in for a surprise. I couldn't write, edit, program, document my programs or blog without it."



And Joel couldn't breathe, eat, walk, or have an erection without SnagIt. That's how important it is. [<:o)]


>BiggBru

Re: The Enterprise Rules Engine

2006-04-14 18:06 • by Bus Raker
68536 in reply to 68535
BiggBru:

Joel on SnagIt:


"You thought SnagIt was just a dinky screen capture utility? Boy, are you in for a surprise. I couldn't write, edit, program, document my programs or blog without it."



And Joel couldn't breathe, eat, walk, or have an erection without SnagIt. That's how important it is. [<:o)]


>BiggBru



Careful soon he'll be as big as Jared from Subway ...

Re: The Enterprise Rules Engine

2006-04-14 18:07 • by Matt
Please tell me how to make the twitching stop.  I've heard rumors of goggles.  Will they help?

Re: The Enterprise Rules Engine

2006-04-14 18:14 • by some jackass
68538 in reply to 68500

There's a name for this:  Second System Syndrome.

Funny. I went to copy and paste the URL to look this up, but accidentally pasted just the above line in to my web browser, and google sent me here:
http://www.ds-health.com/trisomy.htm

The title, for those too lazy to click the link, reads: "Trisomy 21: The Story of Down Syndrome" ;)

Re: The Enterprise Rules Engine

2006-04-14 18:20 • by Alex Papadimoulis
68539 in reply to 68534

Jeff S:
Anonymous:
IsCancellable would be a calculated field from Order Status which is a WTF in live a database


I think we have the first "WTF comment of the day!" award.  Congratulations!

IsCancellable is an *attribute* of an Order Status.   If you have a table defining your order statuses (hopefully, if you are using foreign keys and all of them other fancy database features) then that is where it belongs.  Not in your code, not in an XML file, not anywhere else.


I would prefer to see this information in a view -- I like the distinction of physical and virtual tables (views). I haven't been convinced that mixing the two help maintainability.


In any case, I'm not sure I'd put this in a view myself, as the last predicate on the rule is based on the user's context.

Re: The Enterprise Rules Engine

2006-04-14 18:26 • by Goplat
68541 in reply to 68527
Cooper:
Of course.  And since this forum software
output is clearly meant to be parsed by another program, rather than
displayed, you are right again.

What do you do, code screen scrapers for a living??




I said "some programs", not THIS program. For being so obsessive about language use, you sure are terrible at reading.

Re: The Enterprise Rules Engine

2006-04-14 18:28 • by Eric Jablow
68542 in reply to 68520
Please look up Java's ChoiceFormat and MessageFormat classes. You won't need your function.

Re: The Enterprise Rules Engine

2006-04-14 18:32 • by Gene Wirchenko
68543 in reply to 68537
Anonymous:
Please tell me how to make the twitching stop.  I've heard rumors of goggles.  Will they help?


The goggle are a no-op and do nothing.

Sincerely,

Gene Wirchenko

Re: The Enterprise Rules Engine

2006-04-14 18:40 • by an(on)im(o)us
In base-12, 1/3 would be 0.4.

Not to mention that 1/5 = 0.24312431_

We should use base-60, or base-420

Good basic idea, god-awful implementation

2006-04-14 18:55 • by sacundim
Some people have mentioned as an alternative calling out to a scripting language, and using that to implement the rules. Another alternative is to use a language where symbolic processing of this sort does not actually suck. Lisp is a prime example, but Haskell, ML and Prolog are also good choices.

Re: The Enterprise Rules Engine

2006-04-14 19:04 • by sacundim
Actually, the more I look at this, the more I get the impression that we're just looking at an unfinished system. That is, I think the people who implemented the classes that are being assembled also meant to have some other piece of code parsing a human-friendly representation, and spitting out the abstract syntax trees that the code shown is constructing by hand.
« PrevPage 1 | Page 2Next »

Add Comment