|
Hi,
I have a query regarding what would be a 'best practice' for SEH in an asp.net web app. At present I have Object as my return type from class functions. Within these functions use a try...catch block and return an error object if there's an error or the correct type, say datatable if the process completes as expected. The calling sub then evaluates the returned type and acts accordingly. While this works ok for me, it is a bit long winded and I can't help feeling I am missing the point somewhere. What do you guys do? Thanks if anyone has any tips.
Shaun
If I had all the money I'd spent on drink, I'd spend it on drink - Sir Henry at Rawlinson's End
|
|
|
|
|
Exceptions are special in that when one is thrown, the .NET runtime will go up the function call-stack until it finds a catch block that can handle the exception. What this means is that you can put a try-catch at the "root" function (the one that calls all the other functions) and any exceptions thrown by any lower functions will be caught in the root function's catch block.
Here's an example:
Sub Main()
Try
DoStuff1()
Catch ex As Exception
' Handle exception
End Try
End Sub
Private Sub DoStuff1()
DoStuff2()
End Sub
Private Sub DoStuff2()
DoStuff3()
End Sub
Private Sub DoStuff3()
' Generate an exception
End Sub
If DoStuff3 generates an exception, .NET will jump to the catch block in Main. This way you can assume that all the values returned from your functions will be correct since if there was an error in the function, .NET would jump to the outer catch block, skipping any code that used the return value.
|
|
|
|
|
I see...
Thanks
Shaun
If I had all the money I'd spent on drink, I'd spend it on drink.
|
|
|
|
|
Is there any programs using which I can design interface of my program before I actually start coding? Something lightweight program that we let me to design or scratch the program. Do you use any program like this? Which? Thanks
|
|
|
|
|
|
Yes I thought about that but computer would be easier,faster, more beautiful and realistic
|
|
|
|
|
Giorgi Dalakishvili wrote: computer would be easier,faster
How would a computer be faster than you with a pen and paper? Seriously, blocking out the general interface using pen and paper is much quicker - you just need to work out what goes where and if you don't like the positioning, you can easily start again.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
I already have some general view of the application and I would like to make a model in computer now. If you now some software for that please write. I haven't posted this in order to argue which is better
|
|
|
|
|
Visio then.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Something more lightweight?
|
|
|
|
|
Visual Studio. Seriously, it's fairly trivial to knock up the framework of your application in VS.NET - and then you'll have something to build on later.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
absolutely. VS is also quicker to make a a mockup than visio, and visio's fake app controls don't look exactly like the real thing either.
--
CleaKO The sad part about this instance is that none of the users ever said anything [about the problem].
Pete O`Hanlon Doesn't that just tell you everything you need to know about users?
|
|
|
|
|
The Grand Negus wrote: Pete O`Hanlon wrote:
Visual Studio. Seriously
It's been a long time since I heard those three words together in a thread where the guy asked for something "lightweight"!
Oh - to be able to award you 10 points for that.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Well, the three tools I use are:
* Pen and paper (or whiteboard if I need to share in realtime)
* Visio (for documentation)
* Visual Studio (because the class diagram gives me what I need and it is easy to create stub code to start off with)
|
|
|
|
|
I found this: http://www.carettasoftware.com/gds/index.html
not professional but can be helpful
|
|
|
|
|
|
It's been a long time since I've heard those three words put together.
Deja View - the feeling that you've seen this post before.
|
|
|
|
|
Good evening,
Well I am responsible for designing the architecture of an application which is supposed to extract data from a web service, cache is locally and perform analysis and show results to the user. Initially the team has tried to make the application in ASP .NET, but due to large size of results, it is not feasible to operate over HTTP mode.
Now I am working on following idea:
- Application will download the data from website (using web service) and cache it locally with expiry time marked
- I will perform analysis in off line mode and show results to the user. User then can run what-if scenarios of the data as well
Functional requirements includes, data security (as data is pretty sensitive) and ROLE based web service access.
I am reading : WSE 3.0, CAB and Smart Client Architecture.
Any other suggestions?
Regards,
:: Platform = Microsoft .NET 2.0
-------------------
Therez No Place like ... 127.0.0.1
|
|
|
|
|
What platforms are you working on? You mention smart client, is that pocket pc or laptop?
Also, just in case you missed it, Soap and web services operate over http.
Sounds like you'll want to maybe load up a DataSet, then encrypt and compress it for travel and store it locally. Now if this is on a laptop, you might be able to get away with just serializing the dataset encrypted and compressed to a file and hydrate it within the app and work with it as an embedded database. If its a pocket pc then you'll want to store it locally in SqlCE and work with it from there.
For the Role based security, you just need a login shell to front your app and handle that in the web service.
I probably missed your real point... let me know if I did.
This statement was never false.
|
|
|
|
|
Please review the below link,
http://www.freeprojectsinfo.com/project_management.html
By,
Senthil Kumar.V
|
|
|
|
|
Hi!
I'd like to integrate "massively" scripting capabilities to my application. I've done this before by "inventing" my own scripting language and a relatively silly interpreter behind it.
But now, while porting the application to .Net, I'd like to use a real scripting environment, ideally JavaScript.
I searched around the web and found Rhino for Java and LUA.
Does anybody have experience with this approach?
I'd like to sandbox the scripting capabilities and expose only a part of the domain model to the scripting - how to perform this?
Thanks for you advice!
Torma
|
|
|
|
|
|
Not in particular, it's interesting. I thing I read about the principle in c't (german)...
I think this approach is something very powerful, too powerful for my needs. The sanboxing is a very important element if I want to give the scripting to users.
I'd like just want to offer a dedicated domain model with only the objects and methods I want to expose in the scripting environment.
I could circumvent the sandboxing by parsing the script for accesses to unallowed objects, but this is to prone to breaches...
It seems there's nothing ready out of the box, but the need seams so obvious to me ... AJAX seems to be the only interest for scripting...
I came only reacently back to MS developping, so I'm not very avare what's available right now. I read about some stripting technology MS withdrew in .Net 2.0 or so (VSA? http://www.codeproject.com/csharp/vsascripting.asp )
I'm not technical enough to do such a thing myself in a correct manner (I'm getting too old )
a+
Torma
-- modified at 15:10 Tuesday 24th April, 2007
|
|
|
|
|
There's an article somewhere around here that uses C# for scripting. But if you're targeting users, Lua is a nice one. Not sure about support in .NET, its been awhile since I worked with it.
This statement was never false.
|
|
|
|
|