Architecture :: Object Instances In High Performance Web Applications
Sep 21, 2010
Imagine I have a class MyTestClass. And I need an instance of this Type throughout my whole web application.Now there are several possibilities to accomplish this.1. Make MyTestClass static, make it contain static methods only
Probably the most performant solution. I'm not feeling lucky about using static fields though. Thread safety? What if my static class contained a static System.Collections.Queue?
It is a very large .txt file (more than 3M), and produced everyday, the content is user's system log like below:
2007-11-01 18:20:42,983 [4520] INFO GetXXX() SERVICE START 2007-11-01 18:21:42,983 [4520] WARING USER ACCESS DENIED 2007-11-01 18:22:42,983 [4520] ERROR INPUT PARAMETER IS NULL CAN NOT CONVERT TO INT32 2007-11-01 18:23:59,968 [4520] INFO USER LOGOUT
I'm building a asp.net web application with lots and lots of controls and huge volumes of data. My application is very slow and it is taking a large amount of time to load the data into the .net controls like grid, tree view etc. I also have some ajaxified pages and controls in my application. I want to reduce the page load time in each postbacks.What are the standards/best practices to be followed while developing large asp.net applications?
i build online course selection for a university now i want to make it layering and i dont know to make it 2 layer or 3 layer i mean mix business layer and database layer because i use linq so it is not require to check request data that in sql from client in business layer because linq check it autimatically to preent injection and etc.is it right?can i put my class and DB class in same place or layer?if i make it 2 layer the performance becom better?
1) I have a question, many kind of applications / programs offer API's for integration.Is it possible to integrate any kind of application / program with any kind of application with the help of API ?i mean two completely different applications/programs with different database structure can still be integrated with each other with the help of API ?2) Where exactly is the API file stored ? i mean in order to integrate 2 applications i need to create an xml file ? and store it where ? or i have to do some modification in the code of my application in order to work with this api integration ? how it works..please guide me in a right direction....
3) Could anyone explain me how this API thing works ? i have been provided a PDF file by the application company that i need to integrate with my database based web application.now i have to make API connections in my code ? or how ?
I have almost 100 website that will update in a condition, I have a winzip archive that contains the files that replaces those websites. I want to know that
I can extract that files in a folder and then copy them to all 100 websites folders
I can extract the archive directly to 100 websites folders
which one is better in performance and less prone to errors
I'm building a new n-tier web application and I would like to know the performance differences between developing my tiers in one single assembly (each tier with its own namespace) or into different assemblies, one for each tier.
I recently received a project that contains multiple web applications with no MVC structure. For starters I've created a library (DLL) that will contain the main Business Logic. The problem is with Caching - If I use the current web context cache object than I might end up with duplicate caching (as the web context will be different for every application).
I'm currently thinking about implementing a simple caching mechanism with a singleton pattern that will allow the different web sites (aka different application domains) to share their "caching wisdom". I'd like to know what is the best way to solve this problem.
I have a WPF Windows application with sqlite database which we distribute to our clients. The application consists of some database table which changes every month. eg. the application users a exchange rate table which is valid for one month.
What is the best approach to update the data in these table. note that the whole application is not changing but only the data in it changing, no change to structur of the database or table.
Even though I'm trying to implement exception handling in a multi-tiered Windows application, catching and throwing exceptions should be the same for Windows and Web (sans global.asax and web.config custom errors).
I have a webform with a texbox that displays exceptions. So my webform invokes a method in BusinessTier class which then invokes a method in DataTier class. How can I throw my DataTier method exception so it reaches my webform?
where to create the BLL and DAL and all classes in it can we place them in the App_code folder as it ll convert them into DLL Files or do we have to create a new class library project for each...
I've posted the same question in the Object Data Source forum. This is a link to it http://forums.asp.net/t/1554083.aspx. Maybe I should've posted here to begin with. There seemed to be some overlap so I wasn't sure which was the best on to post the question in.
I'm trying to get a better understanding of how I could've designed my app so that the Object Data Source could work with the properties of my business objects. Please read the other post to see how it's currently being done. Sorry for the link to the other page. I didn't want to post a bunch of duplicate information. I would love to get some suggestions for alternative ways of doing this.
Edit: I would like to keep the infrastructure as is, so while the framework ideas are appreciated, please keep your suggestions centered on the context I have provided.
Background
I'm building a web-based application that dynamically loads plugins. Each plugin comes with a manifest file that contains its dll location, namespace, and type.
Right now I'm using System.Reflection.Assembly.LoadFile to load up the dlls based off the locations provided in the manifest files. Then I load the types and so on.
As an Aside: I may wind up changing to System.Reflection.Assembly.LoadFrom since I'll eventually be loading files from outside the bin directory. But if their is a better way (Assembly.Load or something), feel free to add that in as well
Problem
The problem is that Multiple plugins can potentially run off the same dll. So I wind up executing System.Reflection.Assembly.LoadFile("Identical.dll") multiple times.
I have the idea to check if my assembly has already been loaded by iterating through AppDomain.CurrentDomain.GetAssemblies(), but I don't know if that will help with performance (or if it will work period, I haven't tried it).
Also, I can't keep a list of loaded assemblies due to the project's design constraints (though you may argue that it's a poor design: I can't change it, even if I wanted to OR agreed with you... so please don't press the issue.
Ultimately my goals are:
Don't ever re-load the same assembly twice. Performance is key.
I have a list of 'client_object', and I want to copy this list into another, I've tried to do a CopyTo, but when I change any value in any list, the chages are done in both..I would like to create a duplicate of the objects, not a reference..
I used bind all GridViews, DetailViews etc. on my page using an ObjectDataSource (unless it wasn't possible to do so). Recently, I've started binding all my contols programatically. I find this a lot cleaner and easier, though some may disagree. Binding with a ObjectDataSource obviously has it advantages and disadvantages, as does doing it programatically.Say I bind a GridView programatically (e.g. GridView1.DataSource = SomeList), when I change page on the GridView, I have to also code this. Each time the page changes I have to call GridView1.DataSource = SomeList again. Obviously with a ObjectDataSource I don't need to do this. I normally stick my SomeList object into the ViewState so when I change page I don't need to hit the database each and every time.
My question is: Is this how the ObjectDataSource works? Does it store it's data in the ViewState and not hit the database again unless you call the .Select method? I like to try and get the best performance out of my applications and hit the database as few times as possible but I don't really like the idea of storing a huge list in the ViewState. Is there a better way of doing this? Is caching per user a good idea (or possible)? Shall I just hit the database everytime instead of storing my huge list in the ViewState? Is it sometimes better to hit the database than to use ViewState?
I have a web service Writed By VB.net Lang return a DataSet Contain many rows , I tried to Call this Web Service From Java applicationput Java Language cant Deal with dataSet , So I need to Convert the Dataset to an Object
<WebMethod()> _ Public Function GetLogBook(ByVal EmployeeNumber As String, _ ByVal EmployeeName As String) As DataSet Dim ds As New DataSet Dim conn As New [code]...
I am working on a legacy application. It uses custom MVC framework and Windows Communication Framework service to bridge the Presentation layer with the rest of the application (i'll call this AppServer).
Every Entity in the AppServer inherits from BaseEntity which contains the method:
[Code]....
As you can see:
if the personObject was not null, but the ContactAddress was, [which is exactly what happens in the construction of a PersonObject in the event that no contact details are provided (hence they are not present in the HashTable and dont get created)] then the code will fail with a null reference exception.
SO:
Is there a fundamental flaw in the way that objects are getting created? It would be easy to point the finger in this direction, however, im sure there must have been some reason for the original architect to choose not to instantiate an empty ContactAddress object every time a Person object is referenced - EG if in a particular Presention->AppServer Request/Response cycle we only want a person's login details - we wouldn't care about the ContactDetails.
FINALLY MY QUESTION:
Is there a clean way to check for null objects within an aggregation, without doing something like:
I am creating an authentication service. This service has one of the methods to validate username and password and return a status based on it.
The validation method has bunch of things to check before it can say user is valid. This method has a pseudo code similar to this:
If UserName and Password is correct
If User Account is Locked (due to invalid attempts)
{[code]....
As you can see there are lots of if else statements that I am writing. It looks more like a procedural programming rather than object oriented.How can I fit such kind of code in object oriented pattern?