an OO design question

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

hi..

i don't know if this is the right group for this..

i have a small application which involves a windows service, and web
services which bascally retrieves files, process them and zips them away
(it's a little more complext then that..) i would like to consult ppl about
creating the right classes for it..
 
Not sure how your app involves a web service and a windows service.
Normally, these are not easy technologies to mix together.

Step away from the technology and describe the problem.
If you jump to the solution too quickly, your design will suffer.

Tell us what the problem is.

You say that you have a web service that retrieves files. Are the files
being uploaded by a client? Why upload to a web service? Why not just to a
web application?

You say that the file will processed and zipped away.

Does the processing have to happen in real time, or can it happen after a
delay?

What security requirements are in play? Is this data transfer happening
over an intranet connection, or are you uploading over the internet?

What kind of clients do you have? Did you write the client software?

How big are the files you are transmitting?

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
ok here goes:

first i was told that if i want to use anything "heavy" like database
reading or file reading, in a windows service i would HAVE to use a web
service becouse they occur on another process while a windows service occurs
in a shared process.

the entire process is batch driven, right no i have 2 portions:

1.
ascii spool report files are uploaded from various sources (MF,AS400,UNIX,SAP)
the files are being uploaded via ftp to my server

each spool file contains in it's first line a record for my application to
read into a database record, this record contains
report type (a string)
report data and time
report user
total lines
total pages

the files come in groups. each group of files represnet a comlete report (as
in monthly payments)
for each group an ascii file uploaded, a file containing only the first
record is also uploaded, this is sort of a manifest of what was sent to me,
incase the files them selves are dropped in a connection i would no somthing
is missing.

i read the manifest, record the files data (which is another process by
itself) and saves them to another location.

once a day i collect all files which were uploaded create my own manifest
(which more or lest contains the same data) and zip the entire thing and send
it via ftp to another server, where it will be gathered by an external
company to be printed.
said company will later then send a single file contaning the status of file
printed (number of actuall pages printed, etc..)

my application simply tracks the file, and lists their statuss

2.
my application reads a database table where each record contains data about
an IMAGE file, as far as i'm concened there are 3 type of files
the first will be a pdf , i have to retireve this one from a unix server and
convert it to tiff image. my appliaction downloads it by http
the 2nd is a tiff which is locatioed on an nt, also downloaded via http.
the 3rd is also a tiff but it's location will be given by a web service
method of another application, the location will vary but will be also http.

the records for each image file contain the method of retrieval by a code
which can retrieved from a table which will holds the actuall location (the
http directory to webservice method)

my application need to be able to automatically recover from errors like
when server and files sources are down, or the files are missing, report them
via mail or another websevice

oh, after the download, it needs to be able to check if the files are valid
by extracting the number of pages they have (if it's 0 the file is invalid)

the files are arranged in packages (each 3-4 records in source table are
linked witha package no)
when i save the files i created a directory with package name, and also save
an xml represnation of the records (a mini manifeset)

once a day i send all the files i collected to an extenal company along with
abound xml manfiest contaning what i sent (the whole thing will be in a zip)

the company will send back an xml file reporting what happened.

as you can see the 2 portions have in principle in commom, but are so
different.

i have 2-3 pages of asp.net pages displaying a table of the records, showing
what happens to them (statuss like sent, recieved, printed pages etc...)

i also have anoter thing about reports parts (each group has sub-groups of
reports which can be identified by the report name, the subgroup is divided
by a report name and uniq id, the 2 compose the actuall file name)

i hold a list which contains the hirarchy of the reports by reports and
report parts

p.s: this is my first net project, i wonder if i can clain net expirience
after this one.

i know it's a lot to take in, but i'm very eager to make it work

(sorry for the typo's)
 
Anonymous,

When you want a good design than you should in my opinion first ask yourself
what has to be the result from my application.

When you have that, than what is the input. I write this because I see an
enormous amount of processes. Sometimes it seems easy to use existing tools,
however sometimes will the work be less when you make them new because the
verification and communication proccesses are more complex than the proccess
itself.

Your application seems for me now an endless chain of batch proccesses with
sending and receiving data.

In my idea can a webservice help you in this. However, than the third party
and your clients should have secured access to your webserver.

Here a link how to use that.

http://msdn.microsoft.com/library/d...atingDistributedWebApplicationWalkthrough.asp

I hope this helps a little bit?

Cor
 
thanks i'll look into it (allthough creating a distrib application will talk
a little more then a walk through here :) )

i would to try use degin patters in here somehow (i've begun reading head
first degin patterns and i also have design patterns in c#) it seems a though
an observer (for notification of new files) and stragtegy (for downloading
files) might be right here.
 
I see absolutely no reason to use a web service in this system. No one is
sending data to you over HTTP. It is coming in over FTP or via your
download. The only use for a web service that I can see is for a client app
to get status data from your database.

I do see the need for seperate processes: one to accept input from FTP and
the other to poll for files from the unix boxes. They can use same class
structure if you want. I can see the need for a proxy pattern to handle the
download, where the local files don't need downloading.
I can see the possible use of a chain of responsibility for converting data
types from PDF to Tiff etc.
I can see a bridge to handle packaging the file for submission to the third
party company. Depending on the source, you appear to have different
packaging standards.
I can see a strategy pattern for handling the upload to the third party
company or companies.

This is a meaty project. When you are done, you undoubtably will be able to
say that you have some good experience with .Net

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Nick,

Because that when you see my sample probably your next question will be.

"What is the advantage from that above FTP that I am talking about?.

Than my answer is, that you have more control over the process.

Think for that on filenames however as well complete verification by
creating complete data classes and correction procedures when there is an
error.

Cor
 
i also didn't see the use of webservcies, even the client app doesn't need
becouse it's gonna an aspnet on the same machine.

but as i said i was warned not to place resource intensive function that
would be called from a windows service, that's the only reason i'm using web
services

in regards to the ftp, ftp really doesn't matter to me becouse it's way the
files are SENT to me, for my application the files are allready located in
local hard drive, so it doesn't accept input (or poll) in ftp.

i havn't gotten around to reading about bridge and proxy patterns yet..


right now i have 2 completly different solutions one for each project i
descibed, i also see 2 other projetcs (from as400, and one from different
sources) coming this way, which i don't know anything about (looks 2 more
solutions :) )
 
You may want to consider using Biztalk for all of this.

You have a lot of entry and exit points. Biztalk provides a solid mechanism
for orchestrating all of it.

--
--- Nick Malik [Microsoft]
MCSD, CFPS, Certified Scrummaster
http://blogs.msdn.com/nickmalik

Disclaimer: Opinions expressed in this forum are my own, and not
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
 
Back
Top