|
1 - Separating the data access to web service make sense for stand-alone applications as it will be distributed to client machines. You can do changes to the WS without redeploying application. But in ASP.NET, since everything is in server, you don't need a WS for data access. You can do it in separate project and refer the assembly in your ASP.NET project.
2 - Personally, I don't prefer using DataSet or DataTable. Use strongly typed DTOs. It will help you to produce clean code.
|
|
|
|
|
Thanks Navaneeth!
1.
I am planning to develop client side application, and it is another reason why I want to provide an additional web service layer. Any comments?
2.
"You can do it in separate project and refer the assembly in your ASP.NET project." -- in the future, I may introduct cache server and file based server, and I want to use a middle layer web service to transparent the data source differences to ASP.Net layer. Any comments? Does such design make senses?
2.
"Use strongly typed DTOs. It will help you to produce clean code." -- never heard of this method before but intersted, could you show more description or recommend some documents please?
regards,
George
|
|
|
|
|
George_George wrote: I am planning to develop client side application, and it is another reason why I want to provide an additional web service layer. Any comments?
If it is as a stand-alone application, abstracting data access on WS is good. You could also consider WCF.
George_George wrote: Does such design make senses?
Sounds like provider pattern to me.
DTO is Data Transfer Object. Read about it here[^].
|
|
|
|
|
See Data Transfer Object[^].
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
George_George wrote: Since ASP.Net can not connect to database but connect to web service, it can not get DataSet/DataTable object easily
What on earth are you talking about ? I connect to databases in ASP.NET all the time, and have returned DataTables, depending on the project I worked on, and what they preferred to do.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Hi Christian,
My concern is,
1. If database schema changes, I have to change ASP.Net code. Using an additional web service layer could make change of database schema transparent to ASP.Net code;
2. I am concerning about using ASP.Net to connect to database is not very secure.
Any comments?
regards,
George
|
|
|
|
|
George_George wrote: If database schema changes, I have to change ASP.Net code
If your database schema changes, you need to change your webservice, too. How often does this happen ?
George_George wrote: I am concerning about using ASP.Net to connect to database is not very secure.
What on earth makes you think that ?
Just to clarify, I assume you're talking about a data layer that connects to a SQL database, not having SQL in your presentation layer, right ?
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks Christian!
And sorry for my bad English.
1.
"If your database schema changes, you need to change your webservice, too. How often does this happen?" -- yes I need to change web service code. But ASP.Net code and some Java JSP code are out of my control (not all, but a part of) -- 3rd party assets. I can not force them to change code. So, I want to provide data presentation as a web service layer to make schema change transparent to all clients.
About how often -- for every month, there is some schema level change.
2.
"What on earth makes you think that ?" -- I have been hacked before at the front layer ASP.Net, and the hacker access database directly.
3.
"Just to clarify, I assume you're talking about a data layer that connects to a SQL database, not having SQL in your presentation layer, right ?" yes.
4.
In the future, I may introduct cache server and file based server, and I want to use a middle layer web service to transparent the data source differences to ASP.Net layer. Any comments? Does such design make senses?
regards,
George
|
|
|
|
|
George_George wrote: "What on earth makes you think that ?" -- I have been hacked before at the front layer ASP.Net, and the hacker access database directly
Well, at some point, you need to present a website to the world and make sure your server is secure, this is not the fault of ASP.NET. A webservice is just the same, it's on a server, and it needs to know your database passwords, etc. The intelligent thing to do is to not make your website have SA access, but only access to run procs, which then define the scope of what people can do with your db if hacked,.
George_George wrote: In the future, I may introduct cache server and file based server, and I want to use a middle layer web service to transparent the data source differences to ASP.Net layer.
In that case, a layer of abstraction may make a lot of sense, yes.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
Thanks Christian,
If you think it makes senses to have an additional data access layer, then any advice or solutions to the two issues I mentioned in my original post?
regards,
George
|
|
|
|
|
1 - if it's a bottleneck depends on your site's traffic and your site's resources
2 - you CAN return a datatable from a webservice, but I'd lean towards passing strongly typed collections of entity objects.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
George_George wrote: About how often -- for every month, there is some schema level change.
Ok. So are you saying your database structure changes every month? You can reduce code changes if you design your database well. Don't access the tables directly on the code. Use views to abstract the internal table structure. Use procedures to abstract the data insertions/updations. In such case, a table structure change will not affect your code. You only need to change the procedures/views.
|
|
|
|
|
See Connecting to Databases in ASP.NET[^] if helpful?
Of one Essence is the human race
thus has Creation put the base
One Limb impacted is sufficient
For all Others to feel the Mace
(Saadi )
|
|
|
|
|
Hello Everybody
I want to send email after getting payment confirmation from PayPall. For example:
1. Customers have chosen product
2. Want to make payments through PayPall
3. If payments confirmation is confirm from PayPall
4. Then I want to add that order into order table
5. Then send a Email confirmation to Customer
What is the best way to do it.
Thanks
Sarfaraj
Sarfarj Ahmed
|
|
|
|
|
|
Dear All,
Are you aware of any face tagging library that is available for .Net? My idea is to have the facility to implement face tagging such as hi5 and facebook do.
I believe that a library which gives the co-ordinates of the faces in an image will be sufficient. What are your ideas in this regard?
Many thanks
|
|
|
|
|
If such a library exists for free, I'd be astounded. I'd not be surprised to find a commercial library, tho.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
hi dear i have installed asp flash control and i drag and dropped in page, it will work in the system only when i hosted that is asking license. i installed free version of flash control. what can i do give me it briefly
thank u
somasekhar
somasekhar
|
|
|
|
|
You add flash with HTML, it's an object tag, from memory. You don't need any control.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
just add this in the design, just corect it a litle.. the file name with yours or with url to yours..
<object classid="clsid:D697CDE7E-AE6D-11cf-96B8-458453540000"
codebase="http://active.macromedia.com/flash4/cabs/swflash.cab#version=4,0,0,0"
id="animation name" width="468" height="60">
<param name="movie" value="animationname.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#FFFFFF">
<embed name="animationname" src="animationname.swf" quality="high" bgcolor="#FFFFFF"
width="468" height="60"
type="application/x-shockwave-flash"
pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash">
</embed>
</object>
|
|
|
|
|
Dear All,
I have been using ASP.NET for quite a while now and this questions has been in my mind for quite a long.
So let us assume that I have two classes LogAction and LogEntry. The class LogAction describes an action that is found in a log such as "Login", "Deleted a record" etc. The class LogEntry implements the actual entry that will be put in the log. This class has a LogAction as one of its entries.
So far so good. Now let us move to the data access layer. Suppose that I have a DAL class for both LogAction and LogEntry. In the DAL of LogAction I implement an Add method which calls a stored procedure which enters a new record in the appropriate table and also other methods such as Get methods.
Now if I want to add a LogEntry in the database I have to check whether the LogAction (which is one of its member) is already in the database. If it is not, I need to insert it.
The question I have is how to implement this logic. I know that for efficiency's sake, the best way would be to implement a separate stored procedure which does all these checks and entries in one connection.
But for the sake of OOP it would be better if the DAL of LogEntry consults with the DAL of LogAction to see if the LogAction is already present etc...
Which in your opinion is the best way to implement such logic. I know that this is a fundumental issue in enterprise application design.
Many thanks for your help!
Chris
|
|
|
|
|
Well, I wouldn't write a DAL for each class, I'd just write one dll. Then I'd write my proc to be as efficient as it can be. I don't NEED to create a LogAction in my C# code, I just need a return from the DB that tells me if one existed in the DB or not.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|
|
I'm using vb.net application form
My form requests user to enter ID in text area to retreive some data for printing
I want to know is it possible to pass this ID as a paramter when I call the web application form without requesting user to submit it I mean that I will send user link of the application form with the ID as a parameter just as we do in a web form.
|
|
|
|
|
From what I understood, you have a windows application where user will enter some id. You need to send that id to your webapplication. Right?
|
|
|
|
|
Naglaa Saeed wrote: just as we do in a web form.
I think this means you're in the wrong forum, b/c you're not asking about an ASP.NET app. In a windows form you pass parameters as properties or to a constructor.
Christian Graus
Driven to the arms of OSX by Vista.
|
|
|
|