Sorry I never got back to you on this, I read through it and it hurt my brain so bad I just left it in my inbox. It still hurts when I read through it - sorry, I have no advice.
Matt > -----Original Message----- > From: [EMAIL PROTECTED] > [mailto:[EMAIL PROTECTED] On Behalf Of > Dan Allen > Sent: Friday, January 02, 2004 11:13 AM > To: Matt Raible > Cc: [EMAIL PROTECTED] > Subject: [Struts-apps] seeking design advice > > > Hey Matt, > > ...as one of your loyal followers (isn't that scary?) I am > wondering if you could offer advice on a design issue. > Sometimes I find myself staring at my computer screen due to > my lack of experience with layered architecture. Often times > I have difficulty choosing what operation belongs in what layer. > > I am designing a statement viewing inteface where the client > can choose from various types of statements (various contract > invoices, usage, etc) some of which are in more than one > format (pdf, xls, txt, html). For the business/datalayer I > have started with > > StatementFacade (or Manager or Delegate) > FileSystemStatementDAO > > I choose "FileSystem" since these files are sitting in a > hierarchial directory structure and I have to find them based > on account number. Since there are several reports, each with > a different directory/file pattern I figured I could have a > method extractAccountDate to pull the account date from > examples such as > > INVOICE_0035_JAN03.report > usage_0035_jan3.txt > wirelessbill_200310_0035.pdf > > As you can see the files all have different patterns and I am > stuck with that reality. In my > > getStatements(custNo, type) > > I want to populate my Statement bean with various fields, one > of which is accountDate. > > ...THE QUESTION: > > how should I parse the file to extract the account date for > the various types of files. Should I use a switch statement? > Should I have a method name for each type of file? How can > I take advantage of inheritance? Can I put the parse in the > constructor of the Statement bean (this seems like the most > logical way) > > Statement > | > +- Invoice > +- UsageReport > +- WirelessBill > > each with a custom constructor? I am a bit stuck here, any > advice would really help. I can't tell you the number of > times while I work I just want to pick up the phone and ask > someone how I should design my system. There is no question > that I need to become more educated on the subject, but the > sad part is, I am probably leaps and bounds ahead of the last > guy...his code was shit. > > Dan > > -- > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > Daniel Allen, <[EMAIL PROTECTED]> > http://www.mojavelinux.com/ > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > "This is a test of the Emergency Broadcast System. If this had > been an actual emergency, do you really think we'd stick around > to tell you?" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - > > > ------------------------------------------------------- > This SF.net email is sponsored by: IBM Linux Tutorials. > Become an expert in LINUX or just sharpen your skills. Sign > up for IBM's Free Linux Tutorials. Learn everything from the > bash shell to sys admin. Click now! > http://ads.osdn.com/?ad_id=1278&alloc_id=3371> &op=click > > _______________________________________________ > > Struts-apps mailing list > [EMAIL PROTECTED] > https://lists.sourceforge.net/lists/listinfo/s> truts-apps > ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Struts-apps mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/struts-apps
