Xcopy Deployment
Xcopy command is used to easily copy all the files of a .Net application to a target installation directory... For applications that do not require any further registration Xcopy is command is the simplest way to distribute your .Net applications...
Do note that Xcopy command does not copy the hidden and system files... Also note that Xcopy creates files with the archive attribute set, whether or not this attribute was set in the source file...If you have a disk that contains files in subdirectories and you want to copy it to a disk that has a different format, you should use the Xcopy command instead of Diskcopy. Since the Diskcopy command copies disks track by track, it requires that your source and destination disks have the same format. Xcopy has no such requirement. In general, use Xcopy unless you need a complete disk image copy or you wish to copy the system files.
PS: All I ever needed to Know, Most of what I needed to know about how to live, And what to do and how to be, I learnt in Kindergarten. Wisdom was not at the top of the Graduate school mountain, But there in the sandbox at Nursery school. These are the things I learned: Share everything. Play fair. Don’t hit people. Put things back where you found them. Clean up your own mess. Don’t take things that aren’t yours. Say sorry when you hurt somebody. ......Be aware of wonder. Remember the little seed in the plastic cup. The roots go down and the plant goes up and Nobody really knows how or why, but we are all like that....
These are the wonderful words of Robert Fulgam... Read his book "All I Need To Know, I Learnt in Kindergarten" and do remember- "Technology should not overwhelm you"...
Thursday, September 16, 2004
Wednesday, September 15, 2004
VJs Tip Of The Day - September 15th 2004
Resource File Generator Tool
Resource file generator tool is used to convert resource file in the form of .txt or .resx files to common language runtime binary .resources files... These files can be compiled into satellite assemblies..
This utility can do conversions in other directions too and uses following classes to do the conversions
ResourceReader Class
ResourceWriter Class
ResXResourceReader Class
ResXResourceWriter Class
The exe name for the tool is ResGen.exe... If you search MSDN with the keyword you will find ample information...
PS: I was wondering when would people start using MSDN to search MSDN and not Google... I am trying to develop this good habit... :-)
Resource file generator tool is used to convert resource file in the form of .txt or .resx files to common language runtime binary .resources files... These files can be compiled into satellite assemblies..
This utility can do conversions in other directions too and uses following classes to do the conversions
ResourceReader Class
ResourceWriter Class
ResXResourceReader Class
ResXResourceWriter Class
The exe name for the tool is ResGen.exe... If you search MSDN with the keyword you will find ample information...
PS: I was wondering when would people start using MSDN to search MSDN and not Google... I am trying to develop this good habit... :-)
Tuesday, September 14, 2004
VJs Tip Of The Day - September 14th 2004
Quick MultiThreading
This is some real quick good info for specific scenarios... If you are writing some workflow logic of yours and in-between you realize that you want to perform some tasks which would be time consuming but actually are also apart from your actual business logic and so you would not want your business logic to waste on performance by waiting for those tasks to complete... Some of the examples of such tasks would be printing, cleaning back-end, doing logging or tracing functionality etc...
Well this is when the System.Threading.ThreadPool class comes real handy... There is a static method called QueueUserWorkItem... You can call this method with the method that you want to execute Asynchronously... The Threadpool will use the first available thread to process your request... Now your main business logic does not need to wait for this function to finish...
Now this function can as well give a call back but then it depends upon your requirements...
Read more about it on MSDN... Click Here...
PS: This tip is a result of my discussions with Matt, a colleague of mine... We often discuss interesting technical stuff in our "Leisure At Work" (LAW can never be illegal right!!)
Note: Caution on multithreading... You should know that if different threads are gonna use the same resource then multithreading might cause performance hits as well... Thanks Kathleen for reminding...
This is some real quick good info for specific scenarios... If you are writing some workflow logic of yours and in-between you realize that you want to perform some tasks which would be time consuming but actually are also apart from your actual business logic and so you would not want your business logic to waste on performance by waiting for those tasks to complete... Some of the examples of such tasks would be printing, cleaning back-end, doing logging or tracing functionality etc...
Well this is when the System.Threading.ThreadPool class comes real handy... There is a static method called QueueUserWorkItem... You can call this method with the method that you want to execute Asynchronously... The Threadpool will use the first available thread to process your request... Now your main business logic does not need to wait for this function to finish...
Now this function can as well give a call back but then it depends upon your requirements...
Read more about it on MSDN... Click Here...
PS: This tip is a result of my discussions with Matt, a colleague of mine... We often discuss interesting technical stuff in our "Leisure At Work" (LAW can never be illegal right!!)
Note: Caution on multithreading... You should know that if different threads are gonna use the same resource then multithreading might cause performance hits as well... Thanks Kathleen for reminding...
Monday, September 13, 2004
VJs Tip Of The Day - September 13th 2004
ToolTip in Windows
Well if you have been doing Web development for a long time in .Net now, if you switch to windows it would pretty much possible for you to search for the standard ToolTip property for all the controls and guess what you won't find it... :-) Windows UI is much more richer than web and so the windows controls try to leverage that... For this reason there is a special ToolTip control which is provided to you in the windows environment which you can associate with any of your controls...
Now what are some of its advantages the code below will tell you:
ToolTip vjsTip = new ToolTip();
vjsTip .InitialDelay = 1500;
vjsTip .ReshowDelay = 1000;
vjsTip .SetToolTip(this.txtZipCode, "You need to provide a zip code only if you are in US or Canada");
Similarly you also have GetToolTip() method... Well so go ahead and try explore more on the ToolTip control...
PS: Hope you all are doing fine!!...How did it feel when a forcible mail did not drop into your mailbox for so many days??... Good!!..Bad!!...Well, after giving you a small break, I am back again to bug you, make you take your pill daily... But if you do not like the pills then drop me a mail I will try that they don't reach you... Otherwise, the second season has begun... :-)
Well if you have been doing Web development for a long time in .Net now, if you switch to windows it would pretty much possible for you to search for the standard ToolTip property for all the controls and guess what you won't find it... :-) Windows UI is much more richer than web and so the windows controls try to leverage that... For this reason there is a special ToolTip control which is provided to you in the windows environment which you can associate with any of your controls...
Now what are some of its advantages the code below will tell you:
ToolTip vjsTip = new ToolTip();
vjsTip .InitialDelay = 1500;
vjsTip .ReshowDelay = 1000;
vjsTip .SetToolTip(this.txtZipCode, "You need to provide a zip code only if you are in US or Canada");
Similarly you also have GetToolTip() method... Well so go ahead and try explore more on the ToolTip control...
PS: Hope you all are doing fine!!...How did it feel when a forcible mail did not drop into your mailbox for so many days??... Good!!..Bad!!...Well, after giving you a small break, I am back again to bug you, make you take your pill daily... But if you do not like the pills then drop me a mail I will try that they don't reach you... Otherwise, the second season has begun... :-)
Monday, September 06, 2004
Very Limited Access To Internet
Hi All,
I have very limited access to internet as of now and I will be getting a new connection set up at my home only by Sept 11th 2004... I have my entire mailing list as well all my work on my laptop/CDs... Only after my internet connection is up I would be able to update any further posts or send tips...
Please bear with me till then...
best wishes,
Vishal Joshi
If You Think YOU CAN... You Can...
I have very limited access to internet as of now and I will be getting a new connection set up at my home only by Sept 11th 2004... I have my entire mailing list as well all my work on my laptop/CDs... Only after my internet connection is up I would be able to update any further posts or send tips...
Please bear with me till then...
best wishes,
Vishal Joshi
If You Think YOU CAN... You Can...
Tuesday, August 31, 2004
VJs Tip Of The Day - August 31st 2004
COM Callable Wrapper(CCW) - In simple terms -CCW is the special wrapper created over your .Net classes so that they appear as COM objects to other COM components... If your .Net application needs to be called by other COM components you need to make sure that CCW is created over your .Net classes...
Runtime Callable Wrapper (RCW) - In simple terms - RCW is a special wrapper created over COM components so that they appear as .Net components to other .Net components... If your .Net components call other COM components then you need to make sure that RCW is created over the COM components that your application calls...
PS: I will be shifting to Milwaukee, WI tomorrow... Till I get my new home set up, I might not be having any access to internet so probably would not be able to send in Tips for a while... I apologize in advance for the same and will try to get back to grove ASAP...
Runtime Callable Wrapper (RCW) - In simple terms - RCW is a special wrapper created over COM components so that they appear as .Net components to other .Net components... If your .Net components call other COM components then you need to make sure that RCW is created over the COM components that your application calls...
PS: I will be shifting to Milwaukee, WI tomorrow... Till I get my new home set up, I might not be having any access to internet so probably would not be able to send in Tips for a while... I apologize in advance for the same and will try to get back to grove ASAP...
Monday, August 30, 2004
VJs Tip Of The Day - August 30th 2004
Maintaining State Across ASP.Net Pages - Continued 4
Due to the weekend you might have lost touch... In that case do browse through the previous tips on the blog site... The current mail is in continuation of previous tips...
There is a possibility of InvalidCastException, which may come in case of using properties with Server.Transfer... If you think for a while you can very easily conclude the possible causes...
1.) SecondPage is called from a page other than the FirstPage
2.) SecondPage is directly loaded
3.) SecondPage is called from any other page using response.redirect
In such a scenario do make sure that you catch this exception and ignore it...
PS: You know blogspot has provided search facility for the blogs... So now if you want to search some specific tip in my blog you can use that search facility and you will get the tip right over there... :-)
Due to the weekend you might have lost touch... In that case do browse through the previous tips on the blog site... The current mail is in continuation of previous tips...
There is a possibility of InvalidCastException, which may come in case of using properties with Server.Transfer... If you think for a while you can very easily conclude the possible causes...
1.) SecondPage is called from a page other than the FirstPage
2.) SecondPage is directly loaded
3.) SecondPage is called from any other page using response.redirect
In such a scenario do make sure that you catch this exception and ignore it...
PS: You know blogspot has provided search facility for the blogs... So now if you want to search some specific tip in my blog you can use that search facility and you will get the tip right over there... :-)
Friday, August 27, 2004
VJs Tip Of The Day - August 27th 2004
Maintaining State Across ASP.Net Pages - Continued 3
Yesterday we discussed on NOT having second parameter to be true in Server.Transer() method while transferring data of first page to next page using properties... Visit the previous tips to follow up...
Now the answer to "WHY" not true... Well, I was trying that out yesterday and I got an exception message:
"The View State is invalid for this page and might be corrupted"...
On exploring more I discovered that: It is that "EnableViewStateMac"* property of the page(which we discussed few days back)is set to true by default... If this property is true ASP.Net makes a check to find out if the viewstate was modified or not when the page was posted from the client... Now as in case of Server.Transfer's second parameter being true what happens is that all the form variables (including viewstate) of the first page is preserved and sent to second page... Here due to EnableViewStateMac being true a check is made by ASP.Net but now as you are no more in first page so it is but obvious that this check will fail... And as in case of properties option without setting second parameter of Server.Transfer as true also the values are transferred so you can as well pass it to be false...
As such you can also make "EnableViewStateMac" as false but that would not be a good idea from security perspective...
*MAC stands for Message Authentication Check
PS: You know Sudhakar Sadasivuni, a fellow MVP has helped to get all our MVP blogs at one place at the site http://www.mvpblog.com... I bet you will find loads of information here so do visit it when you find time...
Yesterday we discussed on NOT having second parameter to be true in Server.Transer() method while transferring data of first page to next page using properties... Visit the previous tips to follow up...
Now the answer to "WHY" not true... Well, I was trying that out yesterday and I got an exception message:
"The View State is invalid for this page and might be corrupted"...
On exploring more I discovered that: It is that "EnableViewStateMac"* property of the page(which we discussed few days back)is set to true by default... If this property is true ASP.Net makes a check to find out if the viewstate was modified or not when the page was posted from the client... Now as in case of Server.Transfer's second parameter being true what happens is that all the form variables (including viewstate) of the first page is preserved and sent to second page... Here due to EnableViewStateMac being true a check is made by ASP.Net but now as you are no more in first page so it is but obvious that this check will fail... And as in case of properties option without setting second parameter of Server.Transfer as true also the values are transferred so you can as well pass it to be false...
As such you can also make "EnableViewStateMac" as false but that would not be a good idea from security perspective...
*MAC stands for Message Authentication Check
PS: You know Sudhakar Sadasivuni, a fellow MVP has helped to get all our MVP blogs at one place at the site http://www.mvpblog.com... I bet you will find loads of information here so do visit it when you find time...
Thursday, August 26, 2004
VJs Tip Of The Day - August 26th 2004
Maintaining State Across ASP.Net Pages - Continued 2
Hi Folks,
I apologize for abruptly stopping the tips... I was not having any access to internet for the last few days... I am shifting to Milwaukee, Wisconsin to join in as a .Net System Architect in an MNC... I will remain busy during this transition but will ensure that I do not display this abrupt behavior again... The tips of Aug 23rd, 24th and 25th are up there on my blog site(Click Here) The current tip is in continuation of the previous tips so please do visit the site and catch up before you move ahead...
4.) Using Properties with Server.Transfer: Make your first page in such a way that you expose the required values in next page as properties in the first page... Then use Server.Transfer to go to the next page(keep the second parameter as false here, WHY SO WE WILL TALK TOMORROW)... Now in the next page using context handler you can get all the properties of the first page...
I am not writing the first page code as it is just simply adding values into properties and calling Server.Transfer and I believe you all know how to do that...
CODE SNIPPET
NextPage Code:
if(Context.Handler != null)
{
string strInternalVariableOfNextPage;
FirstPage objFirstPage = new FirstPage();
objFirstPage = (FirstPage)Context.Handler;
//Note that SomeValue is a public property of First Page
strInternalVariableOfNextPage = objFirstPage.SomeValue;
}
PS: I like receiving mails that blast me on not sending the tips... This keeps me motivated so thanks to all those who wrote in those mails...
Hi Folks,
I apologize for abruptly stopping the tips... I was not having any access to internet for the last few days... I am shifting to Milwaukee, Wisconsin to join in as a .Net System Architect in an MNC... I will remain busy during this transition but will ensure that I do not display this abrupt behavior again... The tips of Aug 23rd, 24th and 25th are up there on my blog site(Click Here) The current tip is in continuation of the previous tips so please do visit the site and catch up before you move ahead...
4.) Using Properties with Server.Transfer: Make your first page in such a way that you expose the required values in next page as properties in the first page... Then use Server.Transfer to go to the next page(keep the second parameter as false here, WHY SO WE WILL TALK TOMORROW)... Now in the next page using context handler you can get all the properties of the first page...
I am not writing the first page code as it is just simply adding values into properties and calling Server.Transfer and I believe you all know how to do that...
CODE SNIPPET
NextPage Code:
if(Context.Handler != null)
{
string strInternalVariableOfNextPage;
FirstPage objFirstPage = new FirstPage();
objFirstPage = (FirstPage)Context.Handler;
//Note that SomeValue is a public property of First Page
strInternalVariableOfNextPage = objFirstPage.SomeValue;
}
PS: I like receiving mails that blast me on not sending the tips... This keeps me motivated so thanks to all those who wrote in those mails...
Wednesday, August 25, 2004
VJs Tip Of The Day - August 25th 2004
Maintaining State Across ASP.Net Pages - Continued 1
3.) Using HttpContext/RequestParams with Server.Transfer: We discussed adding to session yesterday, similarly you can add to HttpContext as well and this eliminates the cleaning code required in the next page like the way it is required in Session... There are other advantages too...
If you use Server.Transfer then all your control values are automatically transferred to the next page you do not have to add anything to the context explicitly here rather just access the values in the coming page... The code example will show this more clearly...
If you have certain values other than the above mentioned then you have to do certain special operations to explicitly add them in the first page and retrieve them in the second...
CODE SNIPPET
FirstPage Code:
//These are the special values being added to context
//we will retrieve them in the next page
context.Items.Add("specialVariableName", "specialVariableValue");
//We set the second parameter of Server.Transfer to True this will help
//sending certain values automatically
Server.Transfer("NextPage.aspx", True);
NextPage Code:
string strValueOfFirstPageTextBox;
string strSpeciallyAddedValue;
//Use Request.Params to get values of the standard variables
//which get automatically transferred
strValueOfFirstPageTextBox = Request.Params.Get("firstPageTextBox")
//Use HttpContext to get the values specially added
strSpeciallyAddedValue = context.Items("specialVariableName")
3.) Using HttpContext/RequestParams with Server.Transfer: We discussed adding to session yesterday, similarly you can add to HttpContext as well and this eliminates the cleaning code required in the next page like the way it is required in Session... There are other advantages too...
If you use Server.Transfer then all your control values are automatically transferred to the next page you do not have to add anything to the context explicitly here rather just access the values in the coming page... The code example will show this more clearly...
If you have certain values other than the above mentioned then you have to do certain special operations to explicitly add them in the first page and retrieve them in the second...
CODE SNIPPET
FirstPage Code:
//These are the special values being added to context
//we will retrieve them in the next page
context.Items.Add("specialVariableName", "specialVariableValue");
//We set the second parameter of Server.Transfer to True this will help
//sending certain values automatically
Server.Transfer("NextPage.aspx", True);
NextPage Code:
string strValueOfFirstPageTextBox;
string strSpeciallyAddedValue;
//Use Request.Params to get values of the standard variables
//which get automatically transferred
strValueOfFirstPageTextBox = Request.Params.Get("firstPageTextBox")
//Use HttpContext to get the values specially added
strSpeciallyAddedValue = context.Items("specialVariableName")
Tuesday, August 24, 2004
VJs Tip Of The Day - August 24th 2004
Maintaining State Across ASP.Net Pages
We will talk about two standard methods of maintaining state across ASP.Net pages today... The more sophisticated methods will be discussed from tomorrow onwards...
1) Using QueryString : You can pass values of one page to another page using Query strings... This is an old ASP custom but for security reason not always recomended in ASP.Net
2) Using Session : You can also pass values of one page to another by storing them in session... Use of session is pretty simple and we have discussed that earlier as well (Click Here)... But do understand the fact that Session variables are to store user specific information which is unique to each user and not each page... Also do note that if you forget to clean the session variables in the next page you might land up increasing the session size like anything effecting performance of your application...
We will talk about two standard methods of maintaining state across ASP.Net pages today... The more sophisticated methods will be discussed from tomorrow onwards...
1) Using QueryString : You can pass values of one page to another page using Query strings... This is an old ASP custom but for security reason not always recomended in ASP.Net
2) Using Session : You can also pass values of one page to another by storing them in session... Use of session is pretty simple and we have discussed that earlier as well (Click Here)... But do understand the fact that Session variables are to store user specific information which is unique to each user and not each page... Also do note that if you forget to clean the session variables in the next page you might land up increasing the session size like anything effecting performance of your application...
Monday, August 23, 2004
VJs Tip Of The Day - August 23rd 2004
Steps to Enable Automatic Transactions in .Net
We have discussed all these steps earlier but now we will club them together to see how you go about doing it....
1. Add TransactionAttribute to your class
2. Derieve your class from ServicedComponents class
3. Give strong name to your assembly
4. Register your class for COM+ services using Regsvcs.exe
We have discussed all these steps earlier but now we will club them together to see how you go about doing it....
1. Add TransactionAttribute to your class
2. Derieve your class from ServicedComponents class
3. Give strong name to your assembly
4. Register your class for COM+ services using Regsvcs.exe
Friday, August 20, 2004
VJs Tip Of The Day - August 20th 2004
Transactions in .Net - Using Services of COM+
To use the services of COM+ and transactions you need to register the assembly that contains you class (transactional) with the COM+... You can do so manually by using .Net Services Installation Tool (Regsvcs.exe)... Well if your client is managed client then you do not need to do this registeration as CLR will do it for you but if you know that at sometime your clients can be unmanaged then it is always useful to register your assembly manually...
To use the services of COM+ and transactions you need to register the assembly that contains you class (transactional) with the COM+... You can do so manually by using .Net Services Installation Tool (Regsvcs.exe)... Well if your client is managed client then you do not need to do this registeration as CLR will do it for you but if you know that at sometime your clients can be unmanaged then it is always useful to register your assembly manually...
Thursday, August 19, 2004
VJs Tip Of The Day - August 19th 2004
TransactionOption
We are getting into the details of TransactionOption today...
1. TransactionOption.Disabled implies that automatic transactions cannot control the object... Still if you want this object to support transaction then it can be done by manual transactions...
2. TransactionOption.NotSupported implies that object context will always be created without transaction for this object no matter whether a transaction is already existing...
3. TransactionOption.Supported implies that if transaction exists the object will run under it, if it does not exist it will run without transaction...
4. TransactionOption.Required implies that if transaction exists the object will run under it, if it does not exist a new transaction will be created...
5. TransactionOption.RequiresNew implies that the a new trasaction is started for every request...
PS: Trivandrum User Group in India launches its own site... First bold move by any User Group in India and I bet it is for good... visit
http://www.t-mug.org/membersite.aspx to see for yourself...
We are getting into the details of TransactionOption today...
1. TransactionOption.Disabled implies that automatic transactions cannot control the object... Still if you want this object to support transaction then it can be done by manual transactions...
2. TransactionOption.NotSupported implies that object context will always be created without transaction for this object no matter whether a transaction is already existing...
3. TransactionOption.Supported implies that if transaction exists the object will run under it, if it does not exist it will run without transaction...
4. TransactionOption.Required implies that if transaction exists the object will run under it, if it does not exist a new transaction will be created...
5. TransactionOption.RequiresNew implies that the a new trasaction is started for every request...
PS: Trivandrum User Group in India launches its own site... First bold move by any User Group in India and I bet it is for good... visit
http://www.t-mug.org/membersite.aspx to see for yourself...
Wednesday, August 18, 2004
VJs Tip Of The Day - August 18th 2004
Transaction Attribute for your class
We discussed that for our class to participate in transactions we need to do certain things... Now we will talk about what those certain things have to be...
One of the things that you need to do is to apply Transaction attribute to your class... You would apply it just before your class declaration... It would look something like:
[Transaction(TransactionOption.Supported)]
Now if you are familiar with COM+ transactions then TransactionOption has values which are very similar to COM+ transaction options...
The TransactionOption values can be Disabled, NotSupported, Supported, Required, RequiresNew... Out of these Required is the default...
We discussed that for our class to participate in transactions we need to do certain things... Now we will talk about what those certain things have to be...
One of the things that you need to do is to apply Transaction attribute to your class... You would apply it just before your class declaration... It would look something like:
[Transaction(TransactionOption.Supported)]
Now if you are familiar with COM+ transactions then TransactionOption has values which are very similar to COM+ transaction options...
The TransactionOption values can be Disabled, NotSupported, Supported, Required, RequiresNew... Out of these Required is the default...
Tuesday, August 17, 2004
VJs Tip Of The Day - August 17th 2004
Transactions in .Net
We talked about Transactions in .Net a few days back... We learnt that how they can be automatic or manual...Now ,we will talk about Automatic Transactions this whole week... Hopefully it will be interesting and useful...
Automatic Transaction manages transaction boundaries for you... But again it manages the boundaries on the basis of what you suggest it to do (you do that by attributes which we will talk in a couple of days... ) The transaction flows from one object to other as instructed... Within its scope, it includes, the objects that are suppose to participate in transactions and leaves out the objects that are not suppose to participate...
Note: Nested transactions are not possible in Automatic model...
PS: I sent a document to my team for review... Two days later a friend/collegue wrote to me that I had sent the wrong document... Till now no reviewer other than her has got back (out of 6-7 in the list)... I was wondering about the chances of reviewers not opening the review attachments which someone sends and also chances of them getting mad if the document was never sent, interstingly both the chances are equally bright... :-)
We talked about Transactions in .Net a few days back... We learnt that how they can be automatic or manual...Now ,we will talk about Automatic Transactions this whole week... Hopefully it will be interesting and useful...
Automatic Transaction manages transaction boundaries for you... But again it manages the boundaries on the basis of what you suggest it to do (you do that by attributes which we will talk in a couple of days... ) The transaction flows from one object to other as instructed... Within its scope, it includes, the objects that are suppose to participate in transactions and leaves out the objects that are not suppose to participate...
Note: Nested transactions are not possible in Automatic model...
PS: I sent a document to my team for review... Two days later a friend/collegue wrote to me that I had sent the wrong document... Till now no reviewer other than her has got back (out of 6-7 in the list)... I was wondering about the chances of reviewers not opening the review attachments which someone sends and also chances of them getting mad if the document was never sent, interstingly both the chances are equally bright... :-)
Monday, August 16, 2004
VJs Tip Of The Day - August 16th 2004
Design Days: Caching and Performance
Usually we assume that Caching is done to improve performance, well it is true but at the same time it may deteriorate the performance as well... It many a times depends on the Cache Hit Ratio... And you should definitely consider your Cache Hit Ratio [CHR] before considering your caching strategy...
To make it more clear consider a scenario in which you cache the state list of a country... Now if user has to select one of the available states then there are bright chances that your cache hit is a success.... It might be a good idea to cache the list instead of retrieving it from the data source all the time...
Now consider that you cache product list for a store like Walmart... You might have millions of product in the database and it is very unlikely that the product selection will lie in the correct category and type... There are more likely chances of miss than of hit, but you will lose time in searching the cache, so here is when you should consider hitting the data source instead of caching...
Now there are options other than caching and there might be other factors governing the decisions, this is just a design suggestion...
PS: 15th August was India's Independence Day... Please accept my belated wishes for a Happy Independence Day... Jai Hind... (Hail India!!)
Usually we assume that Caching is done to improve performance, well it is true but at the same time it may deteriorate the performance as well... It many a times depends on the Cache Hit Ratio... And you should definitely consider your Cache Hit Ratio [CHR] before considering your caching strategy...
To make it more clear consider a scenario in which you cache the state list of a country... Now if user has to select one of the available states then there are bright chances that your cache hit is a success.... It might be a good idea to cache the list instead of retrieving it from the data source all the time...
Now consider that you cache product list for a store like Walmart... You might have millions of product in the database and it is very unlikely that the product selection will lie in the correct category and type... There are more likely chances of miss than of hit, but you will lose time in searching the cache, so here is when you should consider hitting the data source instead of caching...
Now there are options other than caching and there might be other factors governing the decisions, this is just a design suggestion...
PS: 15th August was India's Independence Day... Please accept my belated wishes for a Happy Independence Day... Jai Hind... (Hail India!!)
Friday, August 13, 2004
VJs Tip Of The Day - August 13th 2004
If you want to use the services provided by COM+ in your .Net then you write Serviced Components...
To write serviced components you will have to include the namespace of System.EnterpriseServices... You will also have to inherit you class from ServicedComponent
PS: For My Records(FMR) - I am travelling to Omaha, NE to celebrate my friends Birthday...
To write serviced components you will have to include the namespace of System.EnterpriseServices... You will also have to inherit you class from ServicedComponent
PS: For My Records(FMR) - I am travelling to Omaha, NE to celebrate my friends Birthday...
Wednesday, August 11, 2004
VJs Tip Of The Day - August 12th 2004
ViewState Encryption- Considerations
Well to add to yesterday's tip, there are few more tips, rather considerations to come on the way related to viewstate encryption...
If you are using SSL for your webpages then you would want to reconsider whether you need this encryption of ViewState seperately or not as your whole data will be encrypted anyways...
The other point is webfarm scenario... When deploying your webapp to Webfarm without sticky sessions if AutoGenerate option is on (which is by default) then there are chances that your each request will go to different machine and ViewState decryption will fail there... You will have to do synchronization activities in this scenario...
Note: Sticky session is a scenario in which, once the first request in a session is served by a particular server all the consecutive requests for that session will be directed to the same server...
PS: I was wondering that if someone reads one useful article from MSDN daily, (note: JUST ONE useful article) how many days would it take for him/her to become "Most Knowledgeable Person" around there... Think about this, I smile when I come up with a number out of my hat... :-)
Well to add to yesterday's tip, there are few more tips, rather considerations to come on the way related to viewstate encryption...
If you are using SSL for your webpages then you would want to reconsider whether you need this encryption of ViewState seperately or not as your whole data will be encrypted anyways...
The other point is webfarm scenario... When deploying your webapp to Webfarm without sticky sessions if AutoGenerate option is on (which is by default) then there are chances that your each request will go to different machine and ViewState decryption will fail there... You will have to do synchronization activities in this scenario...
Note: Sticky session is a scenario in which, once the first request in a session is served by a particular server all the consecutive requests for that session will be directed to the same server...
PS: I was wondering that if someone reads one useful article from MSDN daily, (note: JUST ONE useful article) how many days would it take for him/her to become "Most Knowledgeable Person" around there... Think about this, I smile when I come up with a number out of my hat... :-)
Tuesday, August 10, 2004
VJs Tip Of The Day - August 11th 2004
Encrypting View State
Few days back we talked about ViewState being Base64 Encoded and that it moves back and forth from client to server... Now if you wish to encrypt the ViewState for security reasons then below is the way to achieve the same...
You have to change your web.config file... In the system.web section of the web.config file you need to add the below tags
<pages enableViewStateMAC="true"/>
<machineKey validation="3DES"/>
PS: Note that here validation="3DES" causes the encryption... enableViewStateMAC causes the check that ViewState is not actually tampered...
Few days back we talked about ViewState being Base64 Encoded and that it moves back and forth from client to server... Now if you wish to encrypt the ViewState for security reasons then below is the way to achieve the same...
You have to change your web.config file... In the system.web section of the web.config file you need to add the below tags
<pages enableViewStateMAC="true"/>
<machineKey validation="3DES"/>
PS: Note that here validation="3DES" causes the encryption... enableViewStateMAC causes the check that ViewState is not actually tampered...
Subscribe to:
Posts (Atom)