[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Subject: RE: [xacml] Proposal of Model for comparing two sequences
.. And how would you serialize and pass Object (or, equivalently void*) over protocols such as CORBA, SOAP and friends.. Or equivalently over extern "C" ?? (void *) what I meant under "living hell".. Ever tried to work with such APIs? In any case - if you look at my original proposal of implementing runtime check of the sequence size of what Selector returns - in the same way the correct GRAMMAR of the attribute values is checked (returning indeterminate when "foo" supplied for an integer) it solves all Match usage issues without requiring any schema changes, or tricky APIs intorduced.. daniel; -----Original Message----- From: Polar Humenn [mailto:polar@syr.edu] Sent: Thursday, September 12, 2002 11:24 AM To: Daniel Engovatov Cc: ''Michiharu Kudoh ' '; '''XACML ' ' ' Subject: RE: [xacml] Proposal of Model for comparing two sequences On Thu, 12 Sep 2002, Daniel Engovatov wrote: > > > > > NO!!! It will make API for extensions a living hell.. > > >How so? > > Please provide an example of an API for extension functions n this > case, in Java or C++.. Okay. To the list: --Forwarded-- From polar@syr.edu Thu Sep 12 14:23:24 2002 Date: Thu, 12 Sep 2002 14:22:01 -0400 (EDT) From: Polar Humenn <polar@syr.edu> To: Daniel Engovatov <dengovatov@crosslogix.com> Subject: RE: [xacml] Proposal of Model for comparing two sequences > Write me an example of an API in a language them more then 10 people outside > computer science departments are using ( I mostly mean Java, C++ and > friends). Without using function pointers/methods, void*/Object etc. Well, you have to be clever in the way you design your interfaces. If I must, in Java: interface Function {} interface BooleanFunction extends Function { boolean eval(Object o1, Object o2) } interface ListBooleanFunction extends Function { boolean eval(BooleanFunction f,List a, List b); } class StringEqual implements BooleanFunction { public boolean eval(Object o1, Object o2) { return ((String)o1).equal((String)o2); } } class AtLeastOne implements ListFunction { boolean eval(BooleanFunction f, List a, List b) { Iterator ai = a.iterator(); while(ai.hasNext()) { Object a_item = ai.next(); Iterator bi = b.iterator(); while(bi.hasNext()) { if (f.eval(a_item,bi.next())) { return true; } } } return false; } } Example: List a = .....; List b = .....; // Expression that determines if one string is common to // both lists of strings boolean result = new AtLeaseOne().eval(new StringEqual(),a,b); There! -Polar
[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [Elist Home]
Powered by eList eXpress LLC