Re: Application logic and Business logic

From: Dmitry A. Kazakov (mailbox_at_dmitry-kazakov.de)
Date: 03/09/05

  • Next message: Miguel Oliveira e Silva: "Re: Application logic and Business logic"
    Date: Wed, 9 Mar 2005 21:06:10 +0100
    
    

    On 9 Mar 2005 10:58:15 -0800, frebe wrote:

    > Dmitry A. Kazakov wrote:
    >> Staff may return a set of employees
    >> and the set may have indexing operation "()". So
    >> Staff (1234)
    >> could be C++ish:
    >> Staff () (1234)
    >
    > So, you are working with arrays in this case.

    It is not array, it is an ADT with has array interface. Internally it could
    be anything.

    > What if you want to find
    > employees living in a given city, using your ADT theory?
    >
    > (
    > My "relational" solution would be:
    > q = staffTab.createQuery();
    > q.setFilter(new Equals(staffTab.city(), "LA"));
    > )

    There are many ways of shaping it:

    1. Staff ("LA");
       -- Staff has two overloaded array interfaces

    2. Staff (Place ("LA"));
       -- Staff is indexed by a filter object. The filter is an ADT with
       -- the functions "and", "or", "not". ID is a constructor of Filter'Class
       -- Place is another constructor.

    3. Staff.Place ("LA");
       -- The member function Place returns a subset of employees living in LA.

    4. Place (Staff, "LA");
       -- Same as above

    5. Staff and Place ("LA");
       -- Intersection of two sets of employees

    6. Place ("LA").Staff;
       -- The member function staff returns a subset of employees of the
       -- city ADT constructed by Place ("LA")

    7. Select (Staff, Place ("LA"));
       -- Same as 5, but using a functional sugar rather than oeprator one
    ...

    The point is that with little exceptions, how does it look tells little
    about how does it work.

    Of course if some caching schemata is needed and the same process may
    concurrently work with several caches, then it would be a good idea to
    expose the context of the cache. That could be the scope of the call:

    do -- This scope is one of the transaction context
       Staff and Place ("LA");
       ...
    exception
       when others =>
          -- on rollback do something useful
    end;

    if the language supports things like above. And only if it that is
    impossible a transaction/query object can explicitly appear in the calls:

    declare
       Context : Transaction;
    begin
       Select (Context, Staff, Place ("LA"));
    -- or
       Context.Select (Staff, Place ("LA"));
    exception
       when others =>
          -- on rollback do something useful
    end;

    which is definitely uglier.

    -- 
    Regards,
    Dmitry A. Kazakov
    http://www.dmitry-kazakov.de
    

  • Next message: Miguel Oliveira e Silva: "Re: Application logic and Business logic"

    Relevant Pages

    • Embassy cable: Snapshots from the Office: Public Affairs Staff Show Strains of Social Discord
      ... FM AMEMBASSY BAGHDAD ... Subject: Snapshots from the Office: Public Affairs Staff Show Strains ... (SBU) The Public Affairs Press Office has 9 local Iraqi employees. ...
      (soc.culture.iraq)
    • McCain, Clinton Pay Women Better than Obama
      ... CNSNews.com Staff Writer ... Senate staffs of John McCain and Hillary Clinton during the latest ... Both McCain and Clinton also employed more female than male staffers, ... 1) the averages for all male or female employees ...
      (sci.military.naval)
    • Re: [OT] As Was Done With Training, Perhaps
      ... Sending someone to class Costs Money. ... Better to invest the money in their staff, value their staff (and be seen to ... here is a description of what permanent employees ... The committe met with the management. ...
      (comp.lang.cobol)
    • Re: A long overdue requirement
      ... when we use temp staff it is because we want temp staff - the company ... simply cannot carry any more permanent staff over the quiet periods. ... All permanent employees are paid, every week, a full time ... If there was insufficient work to pay the bills and the float was all ...
      (uk.legal)
    • Re: Checking In
      ... was still too small to fit me in among the employees that he needed there. ... Although I hadn't really planned to completely retire, quite yet, they warned me about a year ago that they didn't expect after this year's tax season, to have enough work for me to continue with my three days a week part-time salary plus partial benefits arrangement. ... Because the nature of the practice has changed, they will spread my remaining clients among the rest of the staff, and hire another CPA. ... So yesterday they took me for a two-and-a-half hour lunch at a nice French restaurant, The staff gave me a couple pieces of Lennox jewelry - a pendant of a sleeping cat curled into a heart shape, and a wristwatch with bracelet-links that are a string of sleeping cats. ...
      (rec.pets.cats.anecdotes)