Review my architecture please

P

Patrick Allmond

I have to write a rather small project quickly, and I am trying to keep
every clean and OO. I am fairly new to .NET. I'd like your comments on my
proposed solution.

Request:
Display a list of summary information (hospitals) with some columns of
information next to each one. The columns represent how many database
records are present, and some other math is done is show statistics of parts
based on whole. No record detail is needed, just summary information about
the records.

Example:
Hospital | totals records | type A records | type B records | % of records
that are type A | % of records that are type B
Walter Reed Hospital | 100 | 10 | 90 | 10% | 90%

I then need to click on the hospital and get the department detail with the
same columns, but (obviously) just for that department.

The data that is being given to me (from an outside product - I have no
choice in the design) has 20 tables. 1 table each for the hospital and
record type (A or B). 10 hospitals, 2 record types = 20 tables. I am
creating my own tables with the hospital and department names.

I have the detailed numbers but I need to calculate the percentages.

Proposed Solution:
Write 2 methods to return the summary information and detail information.
The Summary method will return all of the records from the hospital table
joined with its data and the calculated percentages. The detail method will
take in the hospital number and return all of the records - again with all
of the appropriate columns.

As I typed this out I realized that I am not sure if I should return a
dataset from each method or an array/array list. Even though my database has
4 columns of data, my presentation layer has to display more than 4 columns.
It also has to display my calculated percentages.

Thanks,
Patrick
 
J

jasonkester

Sounds like you're on the right track. I'd definately recommend
DataSets over ArrayLists for handling the returned data. If you need
to, you can even modify the data locally before binding.

I'm curious why you don't simply add two tables of your own and dump
that mess of legacy data into them, along with a SourceID column to get
it back out. It would certainly simplify your code, since you'd be
looking at a grand total of 2 stored procedures rather than 20 (or a
mess of dynamic sql).

Jason Kester
Expat Software Consulting Services
http://www.expatsoftware.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,781
Messages
2,569,615
Members
45,299
Latest member
JewelDeLaC

Latest Threads

Top