Frank W. Zammetti wrote:

ArrayList getClientList();
ClientDTO getClientInfo(String id);
boolean saveClient(ClientDTO client);
boolean deleteClient(String id);

In any case, only these FBs know anything about how the data is stored.
I do much the same thing defined as an interface so I can switch persistence mechanisms.

(Hey, shouldn't getClientList return a List? ;)

I've never actually switched persistence mechanisms, of course, which leads me to wonder if I really need[ed] to do all that work. :/

I even toyed at one point with the idea of doing all of the above from a
config file and reducing the app to a single specialized Action in most
places.  When you find that most of your Actions look like the above,
that's a fairly appealing idea!
That's actually where I'm headed right now for generic CMS/CRUD, but I'm getting bogged down.

*sigh*

So, to Rick's original point, I guess this really isn't as OO as we all
started out learning :)

Well, yes and no--Common Lisp implements its OO by using generic methods:

(when (isValid cfbh cfb)
 (save cfb cdto))

so you still write an isValid and a save for each useful combination of FB and FBHelpers, but methods are dispatchedd based on the types of the parameters. More or less the same as if you wrote a class like this:

public class SortaGeneric {
   public static boolean isValid(ClientFBHelper cfbh_, ClientDTO cdto_) {
       // ... and then a miracle occurs
       return resultsOfClientDtoValidation;
   }
   public static boolean isValid(CompanyFBHelper cfbh_, CompanyDTO cdto_) {
       // ... you get the idea
   }
}

and did

if (SortaGeneric.isValid(cfbh, cdto)) {
   if (SortaGeneric.save(cdto)) {
   }
}

but in Lisp you can define the generics in a more appropriate place than a non-local static method class.

The only real difference between this and what you've done is the location of those methods--basically OO-by-hand rather than letting the system do it for you. With mild config and reflection you could remove the class depedencies in the actions, which is where my low-level stuff seems to be heading at the moment.

Dave



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to