Proper Architecture

  • Thread starter Thread starter DKode
  • Start date Start date
D

DKode

I have created an application that will be used for my IT depts.
Tasks. I believe I have created the correct architecture but it
doesn't feel correct. Could I get opionions if I am headed in the
right direction? Here is how I have it set up.

UI -> Business Rules layer -> WebService (Broadcasting from SQL
Server) -> DataLayer -> SQL Helper -> SQL Server

I'll start out at the UI and work my way back.

Windows application with the presentation layer and business rules
layer installed on each users machine. Call is made to the business
rules layer which creates a new instance of the webservice and calls
the same method name in the webservice. WebService is sitting on the
SQL Server IIS. Webservice creates an instance of the datalayer in
it's constructor. webservice calls the same method name on the
datalayer. Datalayer creates an instance of the SQL Helper class and
makes a call to generalized functions. I.E. FillDataSet, the
filldataset has 3 overloaded functions so i can pass some different
options to it. ie: dataset, sqlCommand, table to fill 2nd function:
dataset, sqlString, table to fill.

I have typed datasets for each of the tables in my database. the
lookup tables all exist together in one dataset. Once, i grab the
results it passes the dataset back up to the UI and performs to proper
databinding. I have not yet created all the update features, i just
started out with the features that grabs information from the sql
server.

what i am wondering is that on each layer I have all the same methods.
ie: GetAllTasks, GetTaskByID, GetTaskUpdates, GetTaskUpdatesByID
etc...

Should I be generalizing these methods once I reach the
webservice/datalayer? I feel like I am re-duplicating code on the
different tiers of my application. I designed this from an example I
have.

Any comments would be greatly appreciated. Thank you.
 
Why do you have a Windows App in the first place? Just what is so important
that it must be done with a windows app that needs to be installed on a
users computer in the first place?

I mean you have Web Service, why not have WEB app instead of a Windows app?

Is it easier for you to create a Windows app using drag and drop and you
don't know how to do a Web app?
If you are going to a lot of trouble with all the tiers, you had better be
developing for both....otherwise, one needs to ask themselves,
"If they created a Web app, why in the world would they then go back to
making a Windows app that hits the same database?"

You are adding all this work via tiers, I hope you plan to use it one
day...as I know NO ONE who makes a Web app and then has their boss come to
them and say, "Can you make this for Windows? I would like for you to have
trouble installing it on all of our computers."

Are you planning on both supporting both a Windows and Web app that hits the
database? I hope you do a R.O.I. HA ha ha

The suggestion of a Rich Client that is only available via Windows is
COMPLETE propaganda and has no general or practical business advantage over
the Web app. If you want a RICH app, use FLASH...not windows....


How's that for throwing a wrench in this silly n-Tier architecture?
 
Generally speaking, you would move the location of your webservice/remoting
boundary like such:

UI->WebService->BusinessRules->DataLayer->SqlHelper->SQLServer

WebService, BusinessRules, DataLayer, and SqlHelper would all reside on one
machine (generally in seperate assemblies though). WebService (or
BusinessRules in some cases) would apply role-based security to its
entry-point methods, if you need role-based security. WebService would not
necessarily export all functionality of BusinessRules to UI, but only the
things actually needed by UI, and possibly repackaged into larger units of
data... for example instead of having GetTaskById and GetTaskUpdatesById in
seperate WebService methods, the GetTaskById would also return the data from
GetTaskUpdatesById, thereby reducing the roundtrips made between UI and
WebService.

Keith Rome
MCDBA/MCAD/CIC
 
Thank you Keith, That helps me quite a bit. I think I still have alot
to learn about n-Tier architecture. As for the first guy here that
responded to my question:

I guess you are the type of person that ONLY develops asp apps for
dotnet. In response to your solution let me ask you this: what if the
sql server WILL NOT be online and is not published behind the ISA
server and we have multiple remote users that will be using this
application from california, to other parts of the state and the
midwest. what happens then with the web app when i do not wish to
publish the server on the public internet? we solve this by using a
vpn connection with my vb apps and private t1 pipes between some
locations. besides, asp is a whole other language that i have not had
time to dive into and I am still learning all the details of VB and
C#.
 
First, it's a very bad practice to put your SQL server outside your
firewall. You are saying, "here is my database, have at it and see if you
can break in".

MORE comments inline below...


DKode said:
Thank you Keith, That helps me quite a bit. I think I still have alot
to learn about n-Tier architecture. As for the first guy here that
responded to my question:

I guess you are the type of person that ONLY develops asp apps for
dotnet. In response to your solution let me ask you this: what if the
sql server WILL NOT be online and is not published behind the ISA
server and we have multiple remote users that will be using this
application from california, to other parts of the state and the
midwest. what happens then with the web app when i do not wish to
publish the server on the public internet?



Who said the web app had to published publically? There are many ways to
secure your web app.
Credit card companies and banks are now making their data available via
secure sites, login, password, unpublished URL's. You can trade stocks via
the net..... You can also change URL's and tell your clients to update
their address.....just like you can with passwords.....

You can also designate that only certain IP address are allowed to
connect..... You can also use VPN if you want..... so there you go, a
private web site, that is uniquely and securely available to only those you
want it to be available.....also, you are not making your SQL Server
publically available....and you can have IIS Servers hitting it , one for
private and one for public......the scenarios are numerous.....OH, and you
don't have to train users on how to use your Windows app, nor do you have
upload new versions, etc. Your boss can make user interface changes on the
fly to make things easier for them to use..no training sessions
needed....easier to locate bugs by referencing a single URL...if somethings
goes down you can easily switch to another URL as a backup......you can also
link to other helpful sites......

AND, if you still wanted to access your SQL Server remotely or VPN, I
believe you can buy an extra NIC card stick it in the same server and give
it an IP address..

It seems like you have a lot to learn about the web, ASP.NET, IIS, IP,
etc......


Now I am beginning to understand why a lot of developers are doing the
things they are doing.....very little knowledge of web apps and asp.net and
drag and drop ease of VB6......too bad their users don't like the difficult
to use VB6 apps out there....
 
Ok,

The reason I have built no ASP.NET websites yet is because it is
another learning curve that I have not had a chance to tackle yet. I
am still trying to grasp the concepts of OOP, let alone trying to
learn another language in the midst of all this. the company i work
for needs everything yesterday and I hardly have time to breath.

I have developed numerous web applications in the past. Alot of PHP
and some PERL. And don't assume that all vb developers use the drag
and drop functionality of vb.net. That was the first thing i disliked
about the IDE.

I also meant that the SQL Server IS NOT on the public internet I.E.
NOT published through the ISA SERVER, which means it is INTERNAL only.

Go ahead and pick apart my comments now, i'm done arguing, i've got
better things to do. have fun!

peace.
 
Back
Top