View Poll Results: Interface name for business logic implementation?

Voters
21. You may not vote on this poll
  • Module

    0 0%
  • UnitOfWork

    3 14.29%
  • WorkUnit

    2 9.52%
  • LogicalUnitOfWork

    1 4.76%
  • Action

    1 4.76%
  • Executable

    2 9.52%
  • BusinessOperation

    3 14.29%
  • BusinessTask

    13 61.90%
Multiple Choice Poll.
Page 1 of 3 123 LastLast
Results 1 to 10 of 22

Thread: What class name should we use for the unit of work?

  1. #1
    Join Date
    Jun 2005
    Posts
    4,231

    Default What class name should we use for the unit of work?

    There is a central concept in Spring Batch (in all batch processing) of the unit of work. Usually an item is read from an input source and processed. The item might be a message, line from a file, record from a database table, etc. The combination of the input and output is common, and there are also jobs which combine the two into a single operation. Transaction boundaries are usually set at the level of several of these units of work (a "batch", or a "chunk"). The interface is pretty much fixed:

    Code:
    public boolean execute();
    implementations return false to inform the framework that there is no more processing to be done (data are exhausted).

    Some pros and cons: "unit of work" has definite connotations of a transaction (which we are only a part of). "Module" is the name used at the moment, but it is a) bland, b) clashes with other uses, principally in OSGi. So we hate it, but it's on the list in case anyone actually disagrees.
    Last edited by Dave Syer; Jun 28th, 2007 at 08:52 AM. Reason: Added interface

  2. #2
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

    Default

    Module: not clear

    UnitOfWork: hmmm.. difficult... record vs chunk.. what does it mean

    WorkUnit: same as unit of work. And using UnitOfWork for a chunk and WorkUnit for a 'record' would be confusing.

    LogicalUnitOfWork: not logical!! I always hate it when I see logical stuff

    Action: not clear.

    Executable: gives me the feeling I'm working with a concurrency library instead of a batch framework.

    BusinessOperation: hmmm.. not clear

    BusinessTask: not clear

    My favorite is UnitOfWork although I completely agree with it being overloaded.. Maybe record, item, message, workatom, atomofwork..

  3. #3
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    I also do not like module, as it says everything and nothing. UnitOfWork sounds got, but is indeed associated with transactions somehow. Action and Executable are too generic in my opinion. I agree with Peter that LogicalXxx is not a good name.
    BusinessTask and BusinessOperation are quite ok. So I from the given list I would choose BusinessTask.

    May I, though, propose another alternative? If we are talking about executing a batch in one transaction and fragmenting this, how about naming one fraction of such a batch a BatchPart?

    Regards,
    Andreas

  4. #4

    Default

    I would suggest Operation or OperationUnit...

    In the given list I vote for BusinessOperation...

    -Patrick

  5. #5
    Join Date
    Jun 2005
    Posts
    4,231

    Default

    I like all the suggestions. Keep them coming.

    We prefer not to use Batch* on balance because it is the name for something that is supposed to be free of the framework (OK so it's a framework interface, but you get my drift). The developer is going to say "OK, where do I implement my business logic?"

    So I'm pleased that people are on the whole in favour of Business*. Let's hear a few more arguments...

  6. #6
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Hello Dave,

    I think you have a point with Batch* names. I'm still pondering on that aspect that the <not named yet> is just a part of a larger whole. Maybe that should be reflected somehow. What do you think of "BusinessTaskPart" or "BusinessOperationFragment"? It's a bit more unwieldy, but it makes explicit the fact that there might be more of it before the task/operation is complete.

    Still thinking...
    Andreas

  7. #7
    Join Date
    Jun 2005
    Posts
    4,231

    Default

    One of the constraints is actually that the name shouldn't be too long, or should be capable of being abbreviated. We find that we use the <name of thing> quite often in discussions about the framework, and about batch processes that are being developed. You have to be able to say something like "StepExecutor uses a RepeatTemplate to iterate over the XXXX executions", and not get your tongue tied in a knot. That is actually my only objection to Business*, but mostly the proposals we have there can be shortened to the * part and they make perfect sense.

  8. #8
    Join Date
    Aug 2004
    Posts
    2,715

    Default

    Thanks for refining the driving forces in the naming process, Dave. I just wonder why you didn't include "Task" in the poll options then.
    Actually I would refrain from choosing a longer name when in conversation it is always expected to be abbreviated. It might then be better to name it in its short form in the first place.

    So I throw in another two suggestions: "Task" and "TaskPart" (which I like as of my explanation above).

    BTW: I really appreciate your effort of finding fitting names. There are too many poorly named classes around.

  9. #9
    Join Date
    Dec 2005
    Posts
    16

    Default

    Job? WorkItem?

  10. #10
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

    Default

    Something with Atom could be a possible solution: atom is the smallest amount of work that can't be divided (within a certain context).

    BatchAtom.. ChunkAtom.. WorkAtom.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •