<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5899981318499751300</id><updated>2012-02-16T07:01:21.017-08:00</updated><category term='Microsoft'/><category term='STRIDE'/><category term='Kenny Maita'/><category term='Threat model'/><title type='text'>.NET Stuff for Geeks. Use that brain...</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>21</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-2738239831085662361</id><published>2012-02-15T11:12:00.000-08:00</published><updated>2012-02-15T11:12:58.701-08:00</updated><title type='text'>Influencer Book Trailer</title><content type='html'>&lt;iframe height="344" src="http://www.youtube.com/embed/l4g_xxguWzI?fs=1" frameborder="0" width="459" allowfullscreen=""&gt;&lt;/iframe&gt;  Tomando el Training =)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-2738239831085662361?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/2738239831085662361/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=2738239831085662361' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/2738239831085662361'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/2738239831085662361'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2012/02/influencer-book-trailer.html' title='Influencer Book Trailer'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://img.youtube.com/vi/l4g_xxguWzI/default.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-953089784937564219</id><published>2008-09-15T10:05:00.000-07:00</published><updated>2008-09-15T10:11:54.316-07:00</updated><title type='text'>Basic trouble-shooting list :)</title><content type='html'>1.       check the event log&lt;br /&gt;2.       google it&lt;br /&gt;3.       reboot&lt;br /&gt;4.       run iisreset&lt;br /&gt;5.       empty the recycle bin&lt;br /&gt;6.       hit ctrl+break&lt;br /&gt;7.       kill the aspnet worker process&lt;br /&gt;8.       clear temporary internet files&lt;br /&gt;9.       touch the config file&lt;br /&gt;10.   degauss the monitor&lt;br /&gt;11.   remove everything from the startup folder&lt;br /&gt;12.   "get latest" and rebuild&lt;br /&gt;13.   login as admin&lt;br /&gt;14.   run ipconfig /renew&lt;br /&gt;15.   check if capslock is on.&lt;br /&gt;16.   run a virus scan&lt;br /&gt;17.   download the latest CTP&lt;br /&gt;18.   disable and then re-enable the network interface&lt;br /&gt;19.   restart services (some/most/all)&lt;br /&gt;20.   change your password&lt;br /&gt;21.   unplug your router, and leave it unplugged for 10 seconds before plugging it back in&lt;br /&gt;22.   clear your cookies&lt;br /&gt;23.   add current site to your trusted zone&lt;br /&gt;24.   disable javascript&lt;br /&gt;25.   try to ping the server&lt;br /&gt;26.   press 'clean solution' from the context menu in the solution explorer&lt;br /&gt;27.   repair the installation&lt;br /&gt;28.   run large magnets over all hard drives&lt;br /&gt;29.   check the network cable&lt;br /&gt;30.   defrag the hard drive&lt;br /&gt;31.   try it in a different browser&lt;br /&gt;32.   run a spyware scan&lt;br /&gt;33.   minimize all windows and check for a modal dialog&lt;br /&gt;34.   ensure configuration is correct&lt;br /&gt;35.   see what has changed recently&lt;br /&gt;36.   run process monitor&lt;br /&gt;37.   run chkdsk /v&lt;br /&gt;38.   revert all checkins from anyone named 'Gazza'&lt;br /&gt;39.   run the windows update service&lt;br /&gt;40.   remove and then recreate all Bluetooth partnerships&lt;br /&gt;41.   do a hardware reset on your mobile device&lt;br /&gt;42.   decompile + monkey punch + duck slap + donkey whack&lt;br /&gt;43.   what would jesus do?&lt;br /&gt;44.   look for suitable workarounds&lt;br /&gt;45.   re-calibrate your Geiger counter&lt;br /&gt;46.   check for packet storms&lt;br /&gt;47.   best to rule out toxicological contamination early on&lt;br /&gt;48.   describe the problem in terms even a child can understand&lt;br /&gt;49.   apply duct tape&lt;br /&gt;50.   increase the timeout duration&lt;br /&gt;51.   increase the maximum threadpool size&lt;br /&gt;52.   write to your local minister or government representative&lt;br /&gt;53.   try using the Microsoft Online Crash Analysis to submit your crash dump bucket-id&lt;br /&gt;54.   disable the customer experience improvement program&lt;br /&gt;55.   eat liver of sacred monkey&lt;br /&gt;56.   import the decryption certificate to the local client certificate store&lt;br /&gt;57.   ensure sql server is setup for mixed mode authentication&lt;br /&gt;58.   bypass proxy server for local addresses&lt;br /&gt;59.   check the hosts file and the routing tables&lt;br /&gt;60.   use filemon to locate any other log files being accessed&lt;br /&gt;61.   check the bios&lt;br /&gt;62.   update the device drivers for all peripherals&lt;br /&gt;63.   attach a debugger, get a memory dump, look at it in a hex reader and post it to a forum&lt;br /&gt;64.   cleanse all user inputs&lt;br /&gt;65.   put a try catch around it&lt;br /&gt;66.   replace the batteries in your wireless mouse and keyboard&lt;br /&gt;67.   recompile all dll's&lt;br /&gt;68.   uninstall the old version, re- install the new version, apply hot fixes patches and upgrades&lt;br /&gt;69.   remove the case from your computer, and aim a fan at it&lt;br /&gt;70.   check that you haven't been blacklisted&lt;br /&gt;71.   run diagnostic checks on surge protection units&lt;br /&gt;72.   add an index&lt;br /&gt;73.   remove an index&lt;br /&gt;74.   recalculate indexes&lt;br /&gt;75.   ensure ftp uses passive mode&lt;br /&gt;76.   recalculate statistics&lt;br /&gt;77.   reboot in safe mode&lt;br /&gt;78.   check kerberos delegation&lt;br /&gt;79.   review query plan&lt;br /&gt;80.   if 'automatically detect settings' is checked/unchecked, then uncheck/check it&lt;br /&gt;81.   kill rogue processes in task manager&lt;br /&gt;82.   run memtest.exe&lt;br /&gt;83.   boot from your emergency repair disks&lt;br /&gt;84.   follow standard knoppix data recovery procedures&lt;br /&gt;85.   tweak-UI&lt;br /&gt;86.   uninstall adobe pdf reader&lt;br /&gt;87.   insert "Debug.WriteLine("up to line 53");" where appropriate&lt;br /&gt;88.   set tracelevel to verbose&lt;br /&gt;89.   flush buffers&lt;br /&gt;90.   % truss -t \!all -t open a.out&lt;br /&gt;91.   use cdb or windbg. add in SOS for clr issues.&lt;br /&gt;92.   field test any lightning protection devices&lt;br /&gt;93.   use a temperature gauge on all hardware components, and compare against safe operating limits from manufacturer&lt;br /&gt;94.   run it inside a VM&lt;br /&gt;95.   check the DPI.&lt;br /&gt;96.   search the knowledge base&lt;br /&gt;97.   enable javascript debugging&lt;br /&gt;98.   turn off friendly http error messages in IE&lt;br /&gt;99.   set the current culture to en-US&lt;br /&gt;100. attach a multi-meter&lt;br /&gt;101.  roll back to your most recent backup&lt;br /&gt;102.  check for GC pressure&lt;br /&gt;103.  empty the MSI cache&lt;br /&gt;104.  temporarily allow popups&lt;br /&gt;105.  look in your spam folder&lt;br /&gt;106.  recompile. wait. recompile.&lt;br /&gt;107.  turn off windows firewall&lt;br /&gt;108.  run caspol and give everything full trust&lt;br /&gt;109.  put yourself in the shoes of the program itself. if you were the program, what would you do?&lt;br /&gt;110.  ask hanselman&lt;br /&gt;111.   try wireshark. failing that, try fiddler. what does tracert show?&lt;br /&gt;112.   check the blueprints and read over the uml.&lt;br /&gt;113.   implement the retry pattern.&lt;br /&gt;114.   rtfm&lt;br /&gt;115.   delete the bios&lt;br /&gt;116.   attach anti-static wrist strap on every appendage&lt;br /&gt;117.   it inside a faraday cage&lt;br /&gt;118.   insert "alert('here');" where appropriate&lt;br /&gt;119.   overwrite every byte in memory the standard five times as pre-scribed by nsa guidelines&lt;br /&gt;120.   reinstall the operating system from the original media provided by the supplier&lt;br /&gt;121.    add a lock statement&lt;br /&gt;122.    blame Irwin the intern&lt;br /&gt;123.    blame the guy who left last week&lt;br /&gt;124.    blame the ESL guy&lt;br /&gt;125.    blame DNS&lt;br /&gt;126.    add a sleep statement&lt;br /&gt;127.    apply a fudge factor.&lt;br /&gt;128.    run a spell checker over your code&lt;br /&gt;129.    light some candles. sacrifice chicken.&lt;br /&gt;130.    set all DWORD's to 0 in the registry. Then delete the registry&lt;br /&gt;131.     drop all databases.&lt;br /&gt;132.     unregister and re-register all dlls&lt;br /&gt;133.     reboot 3 times&lt;br /&gt;134.     drink own urine&lt;br /&gt;135.     run prime95 overnight&lt;br /&gt;136.     recompile the kernel&lt;br /&gt;137.     do the packets hop subdomains, and if so does NAS require a NAS forwarding service -- how about VLAN?&lt;br /&gt;138.     track down the original programmers who wrote the system, apply percussive trauma therapy.&lt;br /&gt;139.    uninstall java&lt;br /&gt;140.    underclock it&lt;br /&gt;141.     ignore it&lt;br /&gt;142.     post a request for comment on theDailyWTF&lt;br /&gt;143.     ask for correlating evidence that the problem even exists&lt;br /&gt;144.     sharpen your wooden stakes before proceeding any further&lt;br /&gt;145.     melt silver crucifixes onto tips of all bullets&lt;br /&gt;146.     fill your water bottle with holy water&lt;br /&gt;147.     call tech support&lt;br /&gt;148.     check when daylight savings begins&lt;br /&gt;149.     simmer ground rhino horn on a bed of whale pancreas&lt;br /&gt;150.     plan and enact your fire evacuation plan&lt;br /&gt;151.     bathe in holy water&lt;br /&gt;152.     increase dosage on all medications. check for interactions.&lt;br /&gt;153.     bury heart of an ox at midnight under crossroads on fullmoon&lt;br /&gt;154.     clean up your desk&lt;br /&gt;155.     check that pump's suction pipe is elevated above bottom of pond. (Float the inlet 18 to 24 inches below the water surface)&lt;br /&gt;156.     wear shoes with six inch cork soles&lt;br /&gt;157.     wear raincoat, goggles, breathing apparatus&lt;br /&gt;158.     climb into an anti static bag&lt;br /&gt;159.     always use a condom&lt;br /&gt;160.     check pressure reading on gauges number 1 and 2&lt;br /&gt;161.      run it through an oscilloscope&lt;br /&gt;162.      check your immunization schedule is up to date&lt;br /&gt;163.      check for seismic/tectonic activity, solar flares, tsunami, meteor showers.&lt;br /&gt;164.      go and get a coffee. come back and look at it with a fresh set of eyes.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-953089784937564219?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/953089784937564219/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=953089784937564219' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/953089784937564219'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/953089784937564219'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2008/09/basic-trouble-shooting-list.html' title='Basic trouble-shooting list :)'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-7371256102668604598</id><published>2008-09-02T16:02:00.000-07:00</published><updated>2008-09-02T16:23:28.207-07:00</updated><title type='text'>Close Vs Dispose -  Eternal discussion</title><content type='html'>If we compare to connection object, Dispose will also clear the connection, whereas Close will not. This means that if you close a connection and then open it, it will work OK, but if you dispose it and then open it, it will throw InvalidOperationException since the connection string is not initialized&lt;br /&gt;&lt;br /&gt;I would always argue that you should call Dispose() on any object that implements IDisposable (as Microsoft Recomend) when you are through with the object. Even if it does nothing. The jit compiiler will optimize it out of the final code anyway(Because of finalizer thread who do the task). If the object contains a Close() but no Dispose() then call Close().&lt;br /&gt;&lt;br /&gt;IL of the Dispose method of Connection Object&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;.method family hidebysig virtual instance void Dispose(bool disposing) cil managed&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;{&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;.maxstack 2&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0000: ldarg.1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0001: brfalse.s L_0017&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0003: ldarg.0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0004: ldnull&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0005: stfld class System.Data.Common.DbConnectionOptions System.Data.SqlClient.SqlConnection::_userConnectionOptions&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_000a: ldarg.0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_000b: ldnull &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_000c: stfld class System.Data.ProviderBase.DbConnectionPoolGroup System.Data.SqlClient.SqlConnection::_poolGroup&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0011: ldarg.0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0012: callvirt instance void System.Data.Common.&lt;strong&gt;DbConnection::Close()&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0017: ldarg.0&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0018: ldarg.1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0019: call instance void System.Data.SqlClient.&lt;strong&gt;SqlConnection::DisposeMe(bool)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_001e: ldarg.0 &lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_001f: ldarg.1&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0020: call instance void [System]System.&lt;strong&gt;ComponentModel.Component::Dispose(bool)&lt;/strong&gt;&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;L_0025: ret&lt;/span&gt;&lt;br /&gt;&lt;span style="font-family:arial;font-size:78%;"&gt;}&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Dispose of Connection Object (C#):&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;protected override void Dispose(bool disposing)&lt;br /&gt;{&lt;br /&gt;if (disposing)&lt;br /&gt;{&lt;br /&gt;this._userConnectionOptions = null;  (make connection string = null)&lt;br /&gt;this._poolGroup = null;                                  (Remove connection from connection pool)&lt;br /&gt;this.Close();                                                              (Close connection)&lt;br /&gt;}&lt;br /&gt;this.DisposeMe(disposing);                         (Dispose Connection)&lt;br /&gt;base.Dispose(disposing);                               (Dispose parent object)&lt;br /&gt;}&lt;/span&gt;&lt;br /&gt;&lt;span style="font-size:78%;"&gt;&lt;br /&gt;&lt;/span&gt;_userConnectionOptions is effectively the processed connection string as theprovider uses it internally&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-7371256102668604598?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/7371256102668604598/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=7371256102668604598' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/7371256102668604598'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/7371256102668604598'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2008/09/close-vs-dispose-eternal-discussion.html' title='Close Vs Dispose -  Eternal discussion'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-8039421387938262916</id><published>2008-09-02T15:55:00.000-07:00</published><updated>2008-09-02T16:01:42.614-07:00</updated><title type='text'>A Recurrent question: Should I initialize las member (fields) and no member variables?</title><content type='html'>NO Never&lt;br /&gt;&lt;br /&gt;Explicitly initializing class member variables and method variables actually reduces performance in .NET.&lt;br /&gt;This article explores the different types of variable initialization schemes available in .NET and the performance impact of each initialization scheme. Measurements indicate that expressly initializing variables slows object initialization by 10% and slows method calls by about 20%.&lt;br /&gt;&lt;br /&gt;In .NET, the Common Language Runtime (CLR) expressly initializes all variables as soon as they are created. Value types are initialized to 0 and reference types are initialized to null. When you expressly initialize your variables, the compiler creates code to set the value of the variables and includes that code as part of your object initialization (for classes) or method call (for methods).&lt;br /&gt;The compiler is not smart enough (Microsoft, take a hint…) to discover this duplicate initialization. Granted, if you initialize a variable to a non-default value (e.g., int A = 3;) the compiler is perfectly justified in creating the extra code. When you instantiate an object (using the new keyword) or make a method call, the following sequence happens:&lt;br /&gt;&lt;br /&gt;1. Your variables are allocated (based on instructions from the compiler).&lt;br /&gt;2. The variables are initialized by the CLR.&lt;br /&gt;3. The code for the object constructor or method is executed.&lt;br /&gt;&lt;br /&gt;The problem here is: if you explicitly initialized your variables, the constructor or method code will initialize your variables again. Is this really a problem? In many cases, the double initialization is not a problem:&lt;br /&gt;If the variables are static (class variables), the initialization is done once during the entire life of the process. If the class is instantiated only a few times or the method is rarely called, the extra initialization time can be safely ignored.&lt;br /&gt;&lt;br /&gt;- But what about those objects instantiated many times in rapid succession?&lt;br /&gt;- What about those methods called thousands of times?&lt;br /&gt;- What is the performance impact?&lt;br /&gt;&lt;br /&gt;Using Visual Studio .NET 2003 in "Release" mode (with the optimizer using default settings) and running on my Win2K 1.6GHz Pentium-M machine:&lt;br /&gt;&lt;br /&gt;Creating an object and not initializing variables ~503mSec (100%)&lt;br /&gt;Creating an object and initializing on definition ~557mSec (111%)&lt;br /&gt;Creating an object and initializing in the constructor ~582mSec (116%)&lt;br /&gt;Calling a method and not initializing local variables ~253mSec (100%)&lt;br /&gt;Calling a method and initializing variables ~316mSec (125%)&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;Conclusions:&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;br /&gt;- If an object is heavily used (created many times a second) – don’t initialize the variables. Not initializing shaves a nice 10% off the initialization. Obviously, if you do time-consuming and lengthy initialization in the constructor – the variable initialization time will become insignificant and lost in the noise.&lt;br /&gt;- For short and quick methods which are heavily used – avoid initializing local variables to default values – just trust the CLR to do it for you.&lt;br /&gt;&lt;br /&gt;Surprisingly, initializing variables in the constructor is a little slower than initializing on definition but this may be explained by the fact that class B has an empty constructor so the constructor calling code might be eliminated by the optimizer, saving a little time.&lt;br /&gt;&lt;br /&gt;source: &lt;a href="http://www.codeproject.com/KB/dotnet/DontInitializeVariables.aspx"&gt;http://www.codeproject.com/KB/dotnet/DontInitializeVariables.aspx&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-8039421387938262916?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/8039421387938262916/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=8039421387938262916' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/8039421387938262916'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/8039421387938262916'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2008/09/recurrent-question-should-i-initialize.html' title='A Recurrent question: Should I initialize las member (fields) and no member variables?'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-4549213185194146178</id><published>2008-07-01T09:16:00.000-07:00</published><updated>2008-09-15T10:04:44.942-07:00</updated><title type='text'>Dispose Pattern</title><content type='html'>C# Sample&lt;br /&gt;&lt;br /&gt;public sealed class MyClass: IDisposable{&lt;br /&gt;// Variable to track if Dispose has been called&lt;br /&gt;private bool disposed = false;&lt;br /&gt;// Implement the IDisposable.Dispose() method&lt;br /&gt;public void Dispose(){&lt;br /&gt;// Check if Dispose has already been called&lt;br /&gt;if (!disposed) {&lt;br /&gt;// Call the overridden Dispose method that contains common cleanup code&lt;br /&gt;// Pass true to indicate that it is called from Dispose&lt;br /&gt;Dispose(true);&lt;br /&gt;// Prevent subsequent finalization of this object. This is not needed&lt;br /&gt;// because managed and unmanaged resources have been explicitly released GC.SuppressFinalize(this);&lt;br /&gt;}&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;// Implement a finalizer by using destructor style syntax&lt;br /&gt;~MyClass() {&lt;br /&gt;// Call the overridden Dispose method that contains common cleanup code&lt;br /&gt;// Pass false to indicate the it is not called from Dispose&lt;br /&gt;Dispose(false);&lt;br /&gt;} // Implement the override Dispose method that will contain common&lt;br /&gt;// cleanup functionality protected virtual void Dispose(bool disposing){ if(disposing){&lt;br /&gt;// Dispose time code . . . }&lt;br /&gt;// Finalize time code . . . }&lt;br /&gt;…}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Passing true to the protected Dispose method ensures that dispose specific code is called. Passing false skips the Dispose specific code. The Dispose(bool) method can be called directly by your class or indirectly by the client.&lt;br /&gt;If you reference any static variables or methods in your finalize-time Dispose code, make sure you check the Environment.HasShutdownStarted property. If your object is thread safe, be sure to take whatever locks are necessary for cleanup.&lt;br /&gt;Use the HasShutdownStarted property in an object's Dispose method to determine whether the CLR is shutting down or the application domain is unloading. If that is the case, you cannot reliably access any object that has a finalization method and is referenced by a static field&lt;br /&gt;&lt;br /&gt;protected virtual void Dispose(bool disposing){ if(disposing){ // dispose-time code . . . } // finalize-time code CloseHandle(); if(!Environment.HasShutDownStarted) { //Debug.Write or Trace.Write – static methods Debug.WriteLine("Finalizer Called"); } disposed = true;}&lt;br /&gt;&lt;br /&gt;Visual Basic .NET sample&lt;br /&gt;&lt;br /&gt;'Visual Basic .NET Code snippet&lt;br /&gt;&lt;br /&gt;Public Class MyDispose&lt;br /&gt;Implements IDisposable&lt;br /&gt;&lt;br /&gt;Public Overloads Sub Dispose()&lt;br /&gt;Implements IDisposable.Dispose&lt;br /&gt;  Dispose(True)&lt;br /&gt;  GC.SuppressFinalize(Me) ' No need call finalizer&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Protected Overridable Overloads Sub Dispose(ByVal disposing As Boolean)&lt;br /&gt;&lt;br /&gt;If disposing Then&lt;br /&gt;   'Free managed resources&lt;br /&gt;&lt;br /&gt;End If&lt;br /&gt;&lt;br /&gt; ' Free unmanaged resources&lt;br /&gt;&lt;br /&gt;End Sub&lt;br /&gt;&lt;br /&gt;Protected Overrides Sub Finalize()&lt;br /&gt;   Dispose(False)&lt;br /&gt;End SubEnd Class&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Common disposable resources include the following:&lt;br /&gt;&lt;br /&gt;&lt;ul&gt;&lt;li&gt;Database-related classes: SqlConnection, SqlDataReader, and SqlTransaction. &lt;/li&gt;&lt;li&gt;File-based classes: FileStream and BinaryWriter. &lt;/li&gt;&lt;li&gt;Stream-based classes: StreamReader, TextReader, TextWriter, BinaryReader, and TextWriter. &lt;/li&gt;&lt;li&gt;Network-based classes: Socket, UdpClient, and TcpClient. &lt;/li&gt;&lt;li&gt;EnterpriseServices: classes that derive from System.EnterpriseServices.ServicedComponent&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-4549213185194146178?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/4549213185194146178/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=4549213185194146178' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/4549213185194146178'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/4549213185194146178'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2008/07/dispose-pattern.html' title='Dispose Pattern'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-1196750647047642954</id><published>2008-06-25T08:42:00.000-07:00</published><updated>2008-11-13T14:33:15.775-08:00</updated><title type='text'>TOOLS for Preventing SQL Injection</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_a774CGO4xa4/SGJpCjGoh9I/AAAAAAAAH0Q/4pKjo1XwG6E/s1600-h/exploits_of_a_mom.png"&gt;&lt;img id="BLOGGER_PHOTO_ID_5215846810952173522" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_a774CGO4xa4/SGJpCjGoh9I/AAAAAAAAH0Q/4pKjo1XwG6E/s400/exploits_of_a_mom.png" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_a774CGO4xa4/SGJozI-q0iI/AAAAAAAAH0I/PIQkXV37dMM/s1600-h/SQLInjection.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5215846546241409570" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_a774CGO4xa4/SGJozI-q0iI/AAAAAAAAH0I/PIQkXV37dMM/s400/SQLInjection.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;:)&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-1196750647047642954?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/1196750647047642954/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=1196750647047642954' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/1196750647047642954'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/1196750647047642954'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2008/06/tools-for-preventing-sql-injection.html' title='TOOLS for Preventing SQL Injection'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_a774CGO4xa4/SGJpCjGoh9I/AAAAAAAAH0Q/4pKjo1XwG6E/s72-c/exploits_of_a_mom.png' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-4089879851133617452</id><published>2008-01-30T05:34:00.000-08:00</published><updated>2008-05-01T22:11:50.897-07:00</updated><title type='text'>Code Review</title><content type='html'>I usually need to have information like this at hand. This is the compilation of techniques to improve General Performance in manage code. This information belong to Microsoft Patterns and Practices and can be found in the MSDN Library. It’s good to know that every Pattern and Practices have its correspondent Checklist which is super useful to verify quickly what we have not checked yet.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://msdn.microsoft.com/practices/topics/perfscale/default.aspx?pull=/library/en-us/dnpag/html/scalenet.asp"&gt;http://msdn.microsoft.com/practices/topics/perfscale/default.aspx?pull=/library/en-us/dnpag/html/scalenet.asp&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Design Considerations:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Design for efficient resource management.&lt;br /&gt;Reduce boundary crossings.&lt;br /&gt;Prefer single large assemblies rather than multiple smaller assemblies.&lt;br /&gt;Factor code by logical layers.&lt;br /&gt;Treat threads as a shared resource.&lt;br /&gt;Design for efficient exception management.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Class Design Considerations:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Do not make classes thread safe by default.&lt;br /&gt;Consider using the sealed keyword.&lt;br /&gt;Consider the tradeoffs of using virtual members.&lt;br /&gt;Consider using overloaded methods.&lt;br /&gt;Consider overriding the Equals method for value types.&lt;br /&gt;Know the cost of accessing a property.&lt;br /&gt;Consider private versus public member variables.&lt;br /&gt;Limit the use of volatile fields.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Garbage Collection Guidelines&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Identify and analyze your application's allocation profile.&lt;br /&gt;Avoid calling GC.Collect.&lt;br /&gt;Consider weak references with cached data.&lt;br /&gt;Prevent the promotion of short-lived objects.&lt;br /&gt;Set unneeded member variables to Null before making long-running calls.&lt;br /&gt;Minimize hidden allocations.&lt;br /&gt;Avoid or minimize complex object graphs.&lt;br /&gt;Avoid preallocating and chunking memory.&lt;br /&gt;Finalize and Dispose Call Close or Dispose on objects that support it.&lt;br /&gt;Use the using statement in Microsoft® C# and Try/Finally blocks in Microsoft Visual Basic®.NET to ensure Dispose is called.&lt;br /&gt;Do not implement Finalize unless required.&lt;br /&gt;Implement Finalize only if you hold unmanaged resources across client calls.&lt;br /&gt;Move the finalization burden to the leaves of object graphs.&lt;br /&gt;If you implement Finalize, implement IDisposable.&lt;br /&gt;If you implement Finalize and Dispose, use the Dispose pattern.&lt;br /&gt;Suppress finalization in your Dispose method.&lt;br /&gt;Allow Dispose to be called multiple times.&lt;br /&gt;Call Dispose on base classes and on IDisposable members.&lt;br /&gt;Keep finalizer code simple to prevent blocking.&lt;br /&gt;Provide thread-safe cleanup code only if your type is thread-safe.&lt;br /&gt;Pinning&lt;br /&gt;If you need to pin buffers, allocate them at startup.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Threading&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Minimize thread creation.&lt;br /&gt;Use the thread pool when you need threads.&lt;br /&gt;Use a Timer to schedule periodic tasks.&lt;br /&gt;Consider parallel versus synchronous tasks.&lt;br /&gt;Do not use Thread.Abort to terminate other threads.&lt;br /&gt;Do not use Thread.Suspend and Thread.&lt;br /&gt;Resume to pause threads.&lt;br /&gt;Asynchronous Calls&lt;br /&gt;Consider client-side asynchronous calls for UI responsiveness.&lt;br /&gt;Use asynchronous methods on the server for I/O bound operations.&lt;br /&gt;Avoid asynchronous calls that do not add parallelism.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Locking and Synchronization&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Determine if you need synchronization.&lt;br /&gt;Determine the approach.&lt;br /&gt;Determine the scope of your approach.&lt;br /&gt;Acquire locks late and release them early.&lt;br /&gt;Avoid locking and synchronization unless required.&lt;br /&gt;Use granular locks to reduce contention.&lt;br /&gt;Avoid excessive fine-grained locks.&lt;br /&gt;Avoid making thread safety the default for your type.&lt;br /&gt;Use the fine grained lock (C#) statement instead of Synchronized.&lt;br /&gt;Avoid locking "this".&lt;br /&gt;Coordinate multiple readers and single writers by using ReaderWriterLock instead of lock.&lt;br /&gt;Do not lock the type of the objects to provide synchronized access.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Boxing and Unboxing&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Avoid frequent boxing and unboxing overhead.&lt;br /&gt;Measure boxing overhead. Use DirectCast in your Visual Basic .NET code.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Exception Management&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Do not use exceptions to control application flow.&lt;br /&gt;Use validation code to avoid unnecessary exceptions.&lt;br /&gt;Use the finally block to ensure resources are released.&lt;br /&gt;Replace Visual Basic .NET On Error Goto code with exception handling.&lt;br /&gt;Do not catch exceptions that you cannot handle.&lt;br /&gt;Be aware that rethrowing is expensive.&lt;br /&gt;Preserve as much diagnostic information as possible in your exception handlers.&lt;br /&gt;Use performance monitor to monitor common language runtime (CLR) exceptions.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Iterating and Looping&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Avoid repetitive field or property access.&lt;br /&gt;Optimize or avoid expensive operations within loops.&lt;br /&gt;Copy frequently called code into the loop.&lt;br /&gt;Consider replacing recursion with looping.&lt;br /&gt;Use for instead of foreach in performance-critical code paths.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;String Operations &lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Avoid inefficient string concatenation.&lt;br /&gt;Use + when the number of appends is known.&lt;br /&gt;Use StringBuilder when the number of appends is unknown.&lt;br /&gt;Treat StringBuilder as an accumulator.&lt;br /&gt;Use the overloaded Compare method for case-insensitive string comparisons.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Arrays&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Prefer arrays to collections unless you need functionality.&lt;br /&gt;Use strongly typed arrays.&lt;br /&gt;Use jagged arrays instead of multidimensional arrays.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Collections&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Analyze your requirements before choosing the collection type.&lt;br /&gt;Initialize collections to the right size when you can.&lt;br /&gt;Consider enumerating overhead.&lt;br /&gt;Prefer to implement IEnumerable with optimistic concurrency. Consider boxing overhead. Consider for instead of foreach.&lt;br /&gt;Implement strongly typed collections to prevent casting overhead.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Reflection and Late Binding&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Prefer early binding and explicit types rather than reflection.&lt;br /&gt;Avoid late binding. Avoid using System.&lt;br /&gt;Object in performance critical code paths.&lt;br /&gt;Enable Option Explicit and Option Strict in Visual Basic.NET.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Code Access Security&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Consider SuppressUnmanagedCodeSecurity for performance-critical, trusted scenarios.&lt;br /&gt;Prefer declarative demands rather than imperative demands.&lt;br /&gt;Consider using link demands rather than full demands for performance - critical, trusted scenarios.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Working Set Considerations&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Load only the assemblies you need.&lt;br /&gt;Consider assemblies that are being loaded as side effects.&lt;br /&gt;Reduce the number of application domains, and/or make assemblies shared assemblies.&lt;br /&gt;Reduce the number of threads.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Native Image Generator (Ngen.exe)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;Scenarios where startup time is paramount should consider Ngen.exe for their startup path. Scenarios that will benefit from the ability to share assemblies should adopt Ngen.exe.&lt;br /&gt;Scenarios with limited or no sharing should not use Ngen.exe.&lt;br /&gt;Do not use Ngen.exe for ASP.NET version 1.0 and 1.1. Consider Ngen.exe for ASP.NET version 2.0. Measure performance with and without Ngen.exe.&lt;br /&gt;Regenerate your image when you ship new versions.&lt;br /&gt;Choose an appropriate base address. Install assemblies in the GAC if you want to use NGEN to get the best performance.&lt;br /&gt;A setup application for an update of a library assembly should run the 'Ngen.exe update' command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-4089879851133617452?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/4089879851133617452/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=4089879851133617452' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/4089879851133617452'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/4089879851133617452'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2008/01/code-review.html' title='Code Review'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-697035349641181602</id><published>2007-11-05T14:01:00.000-08:00</published><updated>2008-05-01T22:13:50.735-07:00</updated><title type='text'>Common Performance Myths</title><content type='html'>&lt;a style="FONT-WEIGHT: bold; TEXT-DECORATION: nonefont-size:120%;color:#ffffff;" name="a"  &gt;&lt;span style="color:#000000;"&gt;Common Performance Myths&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="font-size:180%;"&gt;1&lt;/span&gt;&lt;/strong&gt; One of the most common myths is that C# code is faster than Visual Basic code. There is a grain of truth in this, as it is possible to take several performance-hindering actions in Visual Basic that are not possible to accomplish in C#, such as not explicitly declaring types. But if good programming practices are followed, there is no reason why Visual Basic and C# code cannot execute with nearly identical performance. To put it more succinctly, similar code produces similar results.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;2&lt;/span&gt; Another myth is that codebehind is faster than inline, which is absolutely false. It doesn't matter where your code for your ASP.NET application lives, whether in a codebehind file or inline with the ASP.NET page. Sometimes I prefer to use inline code as changes don't incur the same update costs as codebehind. For example, with codebehind you have to update the entire codebehind DLL, which can be a scary proposition.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;3&lt;/span&gt; Myth number three is that components are faster than pages. This was true in Classic ASP when compiled COM servers were much faster than VBScript. With ASP.NET, however, both pages and components are classes. Whether your code is inline in a page, within a codebehind, or in a separate component makes little performance difference. Organizationally, it is better to group functionality logically this way, but again it makes no difference with regard to performance.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-size:180%;"&gt;4&lt;/span&gt; The final myth I want to dispel is that every functionality that you want to occur between two apps should be implemented as a Web service. Web services should be used to connect disparate systems or to provide remote access to system functionality or behaviors. They should not be used internally to connect two similar systems. While easy to use, there are much better alternatives. The worst thing you can do is use Web services for communicating between ASP and ASP.NET applications running on the same server, which I've witnessed all too frequently.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-697035349641181602?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/697035349641181602/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=697035349641181602' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/697035349641181602'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/697035349641181602'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2007/11/common-performance-myths.html' title='Common Performance Myths'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-6450178122434301637</id><published>2007-10-24T14:10:00.000-07:00</published><updated>2008-11-13T14:33:15.911-08:00</updated><title type='text'>Web Client Software Factory</title><content type='html'>&lt;a href="http://4.bp.blogspot.com/_a774CGO4xa4/Rx-1L0fbxqI/AAAAAAAAGGM/IBcW-18wvMU/s1600-h/WCSF_corechallenges.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5125014115644589730" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_a774CGO4xa4/Rx-1L0fbxqI/AAAAAAAAGGM/IBcW-18wvMU/s320/WCSF_corechallenges.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;Web Client Software Factory - Release June 2007&lt;br /&gt;&lt;br /&gt;Architects and developers can use the Web Client Software Factory to quickly incorporate many of the proven practices and patterns of building Web client applications. These practices and patterns have been identified during the development of many Web client applications and their components.&lt;br /&gt;By using the software factory, architects and developers can focus their efforts on business opportunities and create Web applications that effectively address the needs of their organizations.&lt;br /&gt;The Web Client Software Factory provides an integrated set of guidance that assists architects and developers in creating composite Web applications and page flow client applications.&lt;br /&gt;These applications have one or more of the following characteristics:&lt;br /&gt;&lt;ul&gt;&lt;li&gt;They have complex page flows and workflows. &lt;/li&gt;&lt;li&gt;They are developed by multiple collaborating development teams. &lt;/li&gt;&lt;li&gt;They are composite applications that present information from multiple sources through an integrated user interface. &lt;/li&gt;&lt;li&gt;They support XCopy deployment of independently developed modules. &lt;/li&gt;&lt;li&gt;They support online business transaction processing Web sites.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;This software factory provides proven solutions to common challenges found while building and operating large transaction processing enterprise Web sites. It helps architects and developers build modular systems that can be built by independent teams, design complex screen workflows, improved security and testability. &lt;/p&gt;&lt;p&gt;Applications built with the software factory use proven practices for operations like centralized exception logging and can be XCopy deployed. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;The software factory contains a collection of reusable components and libraries, Visual Studio 2005 solution templates, wizards and extensions, How-to topics, automated tests, extensive architecture documentation, patterns, and a reference implementation. The software factory uses ASP.NET, Windows Workflow Foundation, and the Enterprise Library–January 2006.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;strong&gt;&lt;em&gt;Software Factory Contents&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;strong&gt;&lt;em&gt;&lt;/em&gt;&lt;/strong&gt;&lt;p&gt;&lt;br /&gt;The Web Client Software Factory is an integrated collection of tailored software assets that support composite Web application development. The collection includes the following: &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Application blocks and libraries. The Composite Web Application Block, Page Flow Application Block, ObjectContainerDataSourceControl control are included in the software factory. The software factory also uses Enterprise Library application blocks for security, exception management, logging, and data access. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Recipes. The software factory includes the Add View (with presenter) recipe and Add Page Flow recipe. Recipes automate procedures in How-to topics, either entirely or selected steps. They help developers complete routine tasks with minimal input. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Templates. The software factory includes the Solution template, Business Module template, Foundational Module template, and Page Flow template. Templates are prefabricated application elements with placeholders for concrete arguments. They can be used for many purposes, including creating initial solution structures to creating individual solution artifacts, such as project items. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Designers. The software factory includes the page flow designer. Designers provide information that architects and developers can use to model applications at a higher level of abstraction. Designers can also generate code that is compatible with the architecture baseline.&lt;br /&gt;Reference implementation. The software factory includes the Global Bank Corporate e-Banking reference implementation. A reference implementation provides an example of a realistic, finished product that the software factory helps developers build. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Architecture guidance and patterns. The software factory includes architecture guidance and patterns that help explain application design choices and the motivation for those choices.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;How-to topics. The software factory includes How-to topics; these are documented step-by-step instructions that describe how to implement recommended practices in a specific domain. &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-6450178122434301637?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/6450178122434301637/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=6450178122434301637' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/6450178122434301637'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/6450178122434301637'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2007/10/web-client-software-factory.html' title='Web Client Software Factory'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_a774CGO4xa4/Rx-1L0fbxqI/AAAAAAAAGGM/IBcW-18wvMU/s72-c/WCSF_corechallenges.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-8764894759005493100</id><published>2007-06-25T09:02:00.000-07:00</published><updated>2007-07-13T11:44:28.916-07:00</updated><title type='text'>Premier Field Engineer  .NET</title><content type='html'>&lt;p&gt;I just wanted to post the profile of the &lt;em&gt;&lt;strong&gt;Microsoft Premier Field Engineer (PFE)&lt;/strong&gt;&lt;/em&gt; because after month and a half of an interviews ...now I'm one of them. For my surprise I recently discover that there are only 930 PFE in the entire world, 560 in the Americas and only 2 in Venezuela. One is PFE in Active Directory and one is PFE in .Net me!, so that means a lot for me. It is not going to be easy and Tons of work is comming.&lt;/p&gt;&lt;p&gt;God is giving me a total new experience and I'm expecting very big blessings in this stage of my career. &lt;/p&gt;&lt;p&gt;&lt;span style="color:#999900;"&gt;&lt;/span&gt;&lt;br /&gt;&lt;strong&gt;&lt;span style="color:#009900;"&gt;Premier Field Engineer .NET&lt;br /&gt;&lt;/span&gt;&lt;/strong&gt;&lt;br /&gt;The purpose of the Premier Field Engineer (PFE) position is to provide Microsoft customers with reliable technical solutions to the complex integration problems associated with business solutions built on the Microsoft platform. The PFE Team supports a diverse variety of technical solutions built with Microsoft technology and products.&lt;br /&gt;&lt;br /&gt;Typical tasks performed in this role include specific problem isolation and correction, user mode debugging, conducting application design and supportability reviews, performance tuning, application stability consulting/troubleshooting, code reviews, and porting/migration assistance, configuration management, pre-rollout testing and general development consulting. The prospective PFE candidate should draw upon all resources at Microsoft, to advise and consult on the use of Microsoft technologies to avoid such problems in the future.&lt;br /&gt;&lt;br /&gt;The PFE position requires a long list of technology experience or demonstrated understanding of these technologies. &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Technical requirements:&lt;/p&gt;&lt;ul&gt;&lt;li&gt;Superior problem solving and troubleshooting skills at a systems engineer level&lt;/li&gt;&lt;li&gt;Solid knowledge and experience with the Microsoft Windows platform and .NET Framework&lt;/li&gt;&lt;li&gt;The ideal PFE skill set is grounded in a solid understanding of the Microsoft Windows platform. From this foundation, the PFE position is exposed to many technologies, including but not limited to: .Net Framework 3.0, .Net Framework 2.0, ASP.Net, BizTalk Server, IIS, SQL Server, Microsoft Office SharePoint Server, and Commerce Server 2000, B2C and B2B applications, development with .NET languages, C#, VB.Net, C/C++, XML and scripting, COM/DCOM/COM+, MSMQ, data access technologies, transaction processing, networking.&lt;br /&gt;&lt;/li&gt;&lt;li&gt;Practical Win 32 user or kernel mode debugging and managed code debugging are preferred skills.&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Qualifications Include: &lt;/p&gt;&lt;ul&gt;&lt;li&gt;Candidates must have exceptional customer service, problem solving, and communication skills, and the ability to work in a team environment.&lt;/li&gt;&lt;li&gt;Must have sufficient technical depth to communicate with development and other internal organizations at a peer level as well as convey technical concepts to non-technical individuals. &lt;/li&gt;&lt;li&gt;Must possess the ability to work with minimal supervision and operate as a self contained business unit within the PFE team. &lt;/li&gt;&lt;li&gt;Must have the ability to work independently and as part of a team. &lt;/li&gt;&lt;li&gt;Must demonstrate the aptitude for providing exceptional customer service in politically charged environments.&lt;/li&gt;&lt;li&gt;Ability to enhance the technical expertise or peers via training, development and delivery , mentoring of new hires, and team content development.&lt;/li&gt;&lt;li&gt;Demonstrate strategic thinking with value-add contributions.&lt;/li&gt;&lt;li&gt;Strong business background in Fortune 500 and/or experience with systems technology consulting firm desired.&lt;br /&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p&gt;Overnight travel is required. Travel requirements vary regionally and could be as much as 40-70%. Candidates must possess current passport or be able to obtain passport within 90 days of hire. They must be available for travel dispatch 24x7x365.&lt;br /&gt;&lt;br /&gt;BS in Computer Science or equivalent experience required. MCSD, MCAD, or other applicable advanced certification is strongly preferred, but not required at hire; however, must be obtained within 12 months of hire.&lt;br /&gt;&lt;br /&gt;Well I like that description!! &lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-8764894759005493100?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/8764894759005493100/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=8764894759005493100' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/8764894759005493100'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/8764894759005493100'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2007/06/premier-field-engineer-net.html' title='Premier Field Engineer  .NET'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-2226582120905167836</id><published>2007-05-17T11:32:00.000-07:00</published><updated>2008-11-13T14:33:16.082-08:00</updated><title type='text'>Designing the Components of an Application or Service</title><content type='html'>&lt;div align="justify"&gt;&lt;a href="http://4.bp.blogspot.com/_a774CGO4xa4/RkykzqMPt5I/AAAAAAAAAz0/EUP5MQon4_U/s1600-h/Componenets.gif"&gt;&lt;img id="BLOGGER_PHOTO_ID_5065604888290899858" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://4.bp.blogspot.com/_a774CGO4xa4/RkykzqMPt5I/AAAAAAAAAz0/EUP5MQon4_U/s320/Componenets.gif" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;strong&gt;User interface (UI) components.&lt;/strong&gt; Most solutions need to provide a way for users to interact with the application. In the retail application example, a Web site lets customers view products and submit orders, and an application based on the Microsoft Windows® operating system lets sales representatives enter order data for customers who have telephoned the company. User interfaces are implemented using Windows Forms, Microsoft ASP.NET pages, controls, or any other technology you use to render and format data for users and to acquire and validate data coming in from them.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;User process components.&lt;/strong&gt; In many cases, a user interaction with the system follows a predictable process. For example, in the retail application you could implement a procedure for viewing product data that has the user select a category from a list of available product categories and then select an individual product in the chosen category to view its details. Similarly, when the user makes a purchase, the interaction follows a predictable process of gathering data from the user, in which the user first supplies details of the products to be purchased, then provides payment details, and then enters delivery details. To help synchronize and orchestrate these user interactions, it can be useful to drive the process using separate user process components. This way the process flow and state management logic is not hard-coded in the user interface elements themselves, and the same basic user interaction "engine" can be reused by multiple user interfaces.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Business workflows.&lt;/strong&gt; After the required data is collected by a user process, the data can be used to perform a business process. For example, after the product, payment, and delivery details are submitted to the retail application, the process of taking payment and arranging delivery can begin. Many business processes involve multiple steps that must be performed in the correct order and orchestrated. For example, the retail system would need to calculate the total value of the order, validate the credit card details, process the credit card payment, and arrange delivery of the goods. This process could take an indeterminate amount of time to complete, so the required tasks and the data required to perform them would have to be managed. Business workflows define and coordinate long-running, multi-step business processes, and they can be implemented using business process management tools such as BizTalk Server Orchestration.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Business components.&lt;/strong&gt; Regardless of whether a business process consists of a single step or an orchestrated workflow, your application will probably require components that implement business rules and perform business tasks. For example, in the retail application, you would need to implement the functionality that calculates the total price of the goods ordered and adds the appropriate delivery charge. Business components implement the business logic of the application.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Service agents.&lt;/strong&gt; When a business component needs to use functionality provided in an external service, you may need to provide some code to manage the semantics of communicating with that particular service. For example, the business components of the retail application described earlier could use a service agent to manage communication with the credit card authorization service, and use a second service agent to handle conversations with the courier service. Service agents isolate the idiosyncrasies of calling diverse services from your application, and can provide additional services, such as basic mapping between the format of the data exposed by the service and the format your application requires.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Service interfaces.&lt;/strong&gt; To expose business logic as a service, you must create service interfaces that support the communication contracts (message-based communication, formats, protocols, security, exceptions, and so on) its different consumers require. For example, the credit card authorization service must expose a service interface that describes the functionality offered by the service and the required communication semantics for calling it. Service interfaces are sometimes referred to as business facades.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Data access logic components.&lt;/strong&gt; Most applications and services will need to access a data store at some point during a business process. For example, the retail application needs to retrieve product data from a database to display product details to the user, and it needs to insert order details into the database when a user places an order. It makes sense to abstract the logic necessary to access data in a separate layer of data access logic components. Doing so centralizes data access functionality and makes it easier to configure and maintain.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Business entity components.&lt;/strong&gt; Most applications require data to be passed between components. For example, in the retail application a list of products must be passed from the data access logic components to the user interface components so that the product list can be displayed to the users. The data is used to represent real-world business entities, such as products or orders. The business entities that are used internally in the application are usually data structures, such as DataSets, DataReaders, or Extensible Markup Language (XML) streams, but they can also be implemented using custom object-oriented classes that represent the real-world entities your application has to work with, such as a product or an order.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Components for security, operational management, and communication.&lt;/strong&gt; Your application will probably also use components to perform exception management, to authorize users to perform certain tasks, and to communicate with other services and applications.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-2226582120905167836?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/2226582120905167836/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=2226582120905167836' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/2226582120905167836'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/2226582120905167836'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2007/05/designing-components-of-application-or.html' title='Designing the Components of an Application or Service'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_a774CGO4xa4/RkykzqMPt5I/AAAAAAAAAz0/EUP5MQon4_U/s72-c/Componenets.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-5690270672335980005</id><published>2007-05-07T07:32:00.000-07:00</published><updated>2008-11-13T14:33:16.225-08:00</updated><title type='text'>Some Software Development Cicle</title><content type='html'>No Words!&lt;br /&gt;&lt;br /&gt;&lt;a href="http://3.bp.blogspot.com/_a774CGO4xa4/Rj84o-T-u_I/AAAAAAAAAzs/rNettijeREI/s1600-h/softwaredevelopment.jpg"&gt;&lt;img id="BLOGGER_PHOTO_ID_5061826782760451058" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_a774CGO4xa4/Rj84o-T-u_I/AAAAAAAAAzs/rNettijeREI/s320/softwaredevelopment.jpg" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-5690270672335980005?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/5690270672335980005/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=5690270672335980005' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/5690270672335980005'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/5690270672335980005'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2007/05/some-software-development-cicle.html' title='Some Software Development Cicle'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_a774CGO4xa4/Rj84o-T-u_I/AAAAAAAAAzs/rNettijeREI/s72-c/softwaredevelopment.jpg' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-1512088137382303931</id><published>2007-02-22T13:08:00.000-08:00</published><updated>2007-02-23T10:47:03.586-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Threat model'/><category scheme='http://www.blogger.com/atom/ns#' term='STRIDE'/><title type='text'>S T R I D E - Threat Modeling</title><content type='html'>&lt;span style="color:#3366ff;"&gt;Security Technology Is Only Part of the Solution&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Implementing security is only part of the solution. Another important part is vigilance. Even if your system has many security safeguards, you need to watch it closely in these ways:&lt;br /&gt;&lt;br /&gt;1. Monitor your system's event logs. Watch for repeated attempts to log into your system or for excessive requests being made against your Web server.&lt;br /&gt;2. Continually keep your application server up to date with the latest security updates for Microsoft Windows and Internet Information Services (IIS), as well as any updates for Microsoft SQL Server or other data sources that your application might use.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#3366ff;"&gt;Threat Modeling&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An important part of developing a more secure application is to understand the threats to it. Microsoft has developed a way to categorize threats: Spoofing, Tampering, Repudiation, Information disclosure, Denial of service, Elevation of privilege (STRIDE).&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;em&gt;Spoofing&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To spoof is to impersonate a user or process in an unauthorized way. At its simplest, spoofing can mean typing in a different user's credentials. A malicious uses might also change the contents of a cookie to pretend that he or she is a different user or that the cookie comes from a different server.&lt;br /&gt;In general, you can help prevent spoofing by using stringent authentication. Any time someone requests access to non-public information, be sure they are who they say they are. You can also help defend against spoofing by keeping credential information safe. For example, do not keep a password or other sensitive information in a cookie, where a malicious user can easily find or modify it.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;Tampering&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Tampering means changing or deleting a resource without authorization. One example is defacing a Web page, where the malicious user gets into your site and changes files. An indirect way to tamper is by using a script exploit. A malicious user manages to get code (script) to execute by masking it as user input from a page or as a link.&lt;br /&gt;A primary defense against tampering is to use Windows security to lock down files, directories, and other Windows resources. The application should also run with minimum privileges. You help guard against script exploits by not trusting any information that comes from a user or even from a database. Whenever you get information from an untrusted source, take steps to be sure it does not contain any executable code.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;&lt;em&gt;Repudiation&lt;/em&gt;&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;A repudiation threat involves carrying out a transaction in such a way that there is no proof after the fact of the principals involved in the transaction. In a Web application, this can mean impersonating an innocent user's credentials. You can help guard against repudiation by using stringent authentication. In addition, use the logging features of Windows to keep an audit trail of any activity on the server.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;Information Disclosure&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;Information disclosure simply means stealing or revealing information that is supposed to be private. A typical example is stealing passwords, but information disclosure can involve access to any file or resource on the server.&lt;br /&gt;The best defense against information disclosure is to have no information to disclose. For example, if you avoid storing passwords, malicious users cannot steal them. An alternative to storing passwords is to store only a hash of the password. When a user presents credentials, you can hash the user's password and compare only the hashes of the two. If you do store sensitive information, use Windows security to help secure it. As always, you should use authentication to help ensure that only authorized users can access restricted information. If you must expose sensitive information, it is recommended that you encrypt the information when stored and use Secure Sockets Layer (SSL) to encrypt the information when sent to and from the browser.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;Denial of Service&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;A denial of service attack is to deliberately cause an application to be less available than it should be. A typical example is to overload a Web application so that it cannot serve ordinary users. Alternatively, malicious users might try to simply crash your server.&lt;br /&gt;IIS enables you to throttle applications, which means that it limits the number of requests it will serve. You might be able to deny access to users or IP addresses known to be malicious. Keeping your applications online is a matter of running robust code. You should test your application thoroughly and respond appropriately to error conditions wherever possible.&lt;br /&gt;&lt;br /&gt;&lt;em&gt;&lt;span style="color:#ff0000;"&gt;Elevation of Privilege&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;&lt;br /&gt;An elevation of privilege attack is to use malicious means to get more permissions than normally assigned. For example, in a successful elevation-of-privilege attack, a malicious user manages to get administrative privileges to your Web server, giving himself or herself access to any data on the server as well as control over server capabilities.&lt;br /&gt;To help protect against elevation of privilege, run the application in a least-privilege context if practical. For example, it is recommended that you do not run ASP.NET applications as the SYSTEM (administrative) user.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-1512088137382303931?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/1512088137382303931/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=1512088137382303931' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/1512088137382303931'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/1512088137382303931'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2007/02/s-t-r-i-d-e-threat-modeling.html' title='S T R I D E - Threat Modeling'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-6506515625085127148</id><published>2007-01-19T07:17:00.000-08:00</published><updated>2008-11-13T14:33:16.799-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kenny Maita'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Basic MSF Models</title><content type='html'>As part of the Process Model and Team Model from MSF.. I just want to have this info at hand because of its importance at the moment to start a project. In case of managers forget it.&lt;br /&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_a774CGO4xa4/RbEQh3afVOI/AAAAAAAAAzM/2t9CwK2p-5Q/s1600-h/Process+Model.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5021813233491596514" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_a774CGO4xa4/RbEQh3afVOI/AAAAAAAAAzM/2t9CwK2p-5Q/s320/Process+Model.JPG" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;A very short description of the Team Model Role's goals&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://3.bp.blogspot.com/_a774CGO4xa4/RbEQLHafVNI/AAAAAAAAAzE/jvf64YwPeBo/s1600-h/Roles+objectives.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5021812842649572562" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_a774CGO4xa4/RbEQLHafVNI/AAAAAAAAAzE/jvf64YwPeBo/s320/Roles+objectives.JPG" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div&gt; &lt;/div&gt;&lt;div&gt;More detailed&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;&lt;a href="http://2.bp.blogspot.com/_a774CGO4xa4/RbEKn3afVMI/AAAAAAAAAy4/9_m_e2vhW88/s1600-h/Team+Model+Roles.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5021806739501044930" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_a774CGO4xa4/RbEKn3afVMI/AAAAAAAAAy4/9_m_e2vhW88/s320/Team+Model+Roles.JPG" border="0" /&gt;&lt;/a&gt; &lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;div&gt;&lt;/div&gt;&lt;br /&gt;&lt;div&gt;MS recommendation for combining roles. Like every step in the envisioning phase of the Process Model,when the complete application is being defined, this combination is so important but at the same time very sub estimated for organizations where there are not enough resources to assign to each role. Bad Bad!&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;a href="http://2.bp.blogspot.com/_a774CGO4xa4/RbDthHafVLI/AAAAAAAAAys/e1AKNZBRw0I/s1600-h/CombiningRoles.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5021774737699722418" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://2.bp.blogspot.com/_a774CGO4xa4/RbDthHafVLI/AAAAAAAAAys/e1AKNZBRw0I/s320/CombiningRoles.JPG" border="0" /&gt;&lt;/a&gt;&lt;/div&gt;&lt;br /&gt;&lt;br /&gt;&lt;div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-6506515625085127148?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/6506515625085127148/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=6506515625085127148' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/6506515625085127148'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/6506515625085127148'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2007/01/team-model-roles.html' title='Basic MSF Models'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_a774CGO4xa4/RbEQh3afVOI/AAAAAAAAAzM/2t9CwK2p-5Q/s72-c/Process+Model.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-1757684201949954458</id><published>2007-01-18T11:57:00.000-08:00</published><updated>2008-11-13T14:33:16.900-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kenny Maita'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Why .Net apps consume so much memory</title><content type='html'>There are many posts out there where people ask why .Net apps consume so much memory…&lt;br /&gt;&lt;br /&gt;I was researching a little and I found very interesting information that I'm going to comment here.&lt;br /&gt;&lt;br /&gt;I, like every body else had a .Net 2.0 Windows application consuming a lot of memory. Initially I eliminated the possibility to minimize the application so it only could be hidden and visible again. When I saw the Task Manager (which now I know is not a good indicator or the real memory a .Net application is using) I was worry because of the high amount of memory being used. Researching I discover Windows allocates private memory (referred later as Private Bytes) and shared memory (private memory plus shared memory is referred later as Working Set) for one single application , and the shared memory can be released if the application doesn’t need it. Surprisingly when an Application is minimized Windows releases the application's shared memory making the value shown in the Task Manager very low. I tested it using some counters with the perform monitor. I added two counters for my application: Private Bytes and Working Set then Running and minimizing my App I got this output:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;p&gt;&lt;a href="http://1.bp.blogspot.com/_a774CGO4xa4/RbFFNnafVPI/AAAAAAAAAzc/2OExsEDCoq8/s1600-h/perfmonDailyMe.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5021871159715517682" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_a774CGO4xa4/RbFFNnafVPI/AAAAAAAAAzc/2OExsEDCoq8/s320/perfmonDailyMe.JPG" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;&lt;p&gt;It shows how the Working Set drops dramatically, but Private Bytes stays flat. When I look the size of my app minimized in the Task Manager I saw it uses two or 3 MB of RAM. Wow!! Then I did the same test with Messenger and GoogleTalk and I got the same result. Windows frees memory when apps are minimized which is logic and great!&lt;br /&gt;&lt;br /&gt;Something else I notice: When you don’t want to show your application minimized to users but still want Windows to release memory then the application’s window must be visible at the moment it is minimized for Windows to recognize the visible change.&lt;br /&gt;&lt;br /&gt;e.g. If you hide the application and later minimized it by code like this&lt;br /&gt;&lt;br /&gt;this.Hide();&lt;br /&gt;this.WindowState = FormWindowState.Minimized;&lt;br /&gt;&lt;br /&gt;Windows won’t recognize that it is minimized then keeping the complete memory allocated for the application (the mem value in the Task Manager does not change). The code should be like this for Windows to be aware that the application is not been used&lt;br /&gt;&lt;br /&gt;this.WindowState = FormWindowState.Minimized;&lt;br /&gt;this.Hide();&lt;/p&gt;&lt;p&gt;&lt;br /&gt;I’m going to copy here some interesting conclusion from Tim Anderson's page. (http://www.itwriting.com/dotnetmem.php)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. Windows generally does a good job of memory management. High figures in Task Manager needn’t concern the user if the system is running well.&lt;br /&gt;&lt;br /&gt;2. .NET applications really do have a high memory footprint relative to most native code applications (Java has the same problem).&lt;br /&gt;&lt;br /&gt;3. Don’t use the mem usage column in Task Manager for diagnostics or profiling.&lt;br /&gt;&lt;br /&gt;4. There isn't much developers can do about the memory footprint of the .NET runtime. However, there is a lot that developers can do to make applications that use memory efficiently and avoid leaks. This mostly involves looking at the .NET counters rather than the system counters. Use of a profiler is near-essential; I like the SciTech ( &lt;a href="http://memprofiler.com"&gt;http://memprofiler.com&lt;/a&gt;).&lt;/p&gt;&lt;br /&gt;&lt;p&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-1757684201949954458?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/1757684201949954458/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=1757684201949954458' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/1757684201949954458'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/1757684201949954458'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2007/01/why-net-apps-consume-so-much-memory.html' title='Why .Net apps consume so much memory'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_a774CGO4xa4/RbFFNnafVPI/AAAAAAAAAzc/2OExsEDCoq8/s72-c/perfmonDailyMe.JPG' height='72' width='72'/><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-271402396181457211</id><published>2007-01-03T06:27:00.000-08:00</published><updated>2007-01-03T06:37:44.360-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kenny Maita'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Best Practices for SQL (Evolving entry)</title><content type='html'>This is an incremental link. Those are links I wanted to put here to find quickly some best practices to design administer and maintain SQL databases.&lt;br /&gt;&lt;br /&gt;Books online/ Sample Data bases. Always huge source of best advises.&lt;br /&gt;&lt;br /&gt;SQL Best Practices&lt;br /&gt;------------------------&lt;br /&gt;http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/default.mspx&lt;br /&gt;&lt;br /&gt;Best Practice Analyzer tool&lt;br /&gt;-------------------------------&lt;br /&gt;http://www.microsoft.com/downloads/details.aspx?FamilyID=B352EB1F-D3CA-44EE-893E-9E07339C1F22&amp;amp;displaylang=en&lt;br /&gt;&lt;br /&gt;Storage Top 10 Best Practices&lt;br /&gt;------------------------------------&lt;br /&gt;http://www.microsoft.com/technet/prodtechnol/sql/bestpractice/storage-top-10.mspx&lt;br /&gt;&lt;br /&gt;Data Patterns (high level)&lt;br /&gt;--------------------------------&lt;br /&gt;http://msdn.microsoft.com/practices/compcat/default.aspx?pull=/library/en-us/dnpatterns/html/dp.asp&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-271402396181457211?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/271402396181457211/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=271402396181457211' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/271402396181457211'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/271402396181457211'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2007/01/best-practices-for-sql-evolving-entry.html' title='Best Practices for SQL (Evolving entry)'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-1889655350284601441</id><published>2006-12-28T10:21:00.000-08:00</published><updated>2008-11-13T14:33:17.118-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kenny Maita'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>LAS VEGAS</title><content type='html'>&lt;a href="http://1.bp.blogspot.com/_a774CGO4xa4/RZQOydrtfaI/AAAAAAAAAAM/bOVkTh1cpmg/s1600-h/DSC01453.JPG"&gt;&lt;img id="BLOGGER_PHOTO_ID_5013648545294417314" style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://1.bp.blogspot.com/_a774CGO4xa4/RZQOydrtfaI/AAAAAAAAAAM/bOVkTh1cpmg/s320/DSC01453.JPG" border="0" /&gt;&lt;/a&gt; &lt;p align="center"&gt;&lt;/p&gt;&lt;p align="center"&gt;&lt;/p&gt;&lt;br /&gt;&lt;p align="center"&gt;Just a break to celebrate (moreee) my 2months vacations in Las Vegas&lt;br /&gt;I'm not going to write anything about it and I'm going to show you only 1 picture from 1500 I took because if you haven’t been there… You can get it!!&lt;br /&gt;&lt;br /&gt;I already decided.. I'm going to live there!!&lt;/p&gt;&lt;p align="center"&gt;&lt;/p&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-1889655350284601441?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/1889655350284601441/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=1889655350284601441' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/1889655350284601441'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/1889655350284601441'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2006/12/las-vegas.html' title='LAS VEGAS'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_a774CGO4xa4/RZQOydrtfaI/AAAAAAAAAAM/bOVkTh1cpmg/s72-c/DSC01453.JPG' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-8469385921331168487</id><published>2006-12-28T09:55:00.000-08:00</published><updated>2007-02-26T12:44:31.700-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kenny Maita'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Working with PDFs</title><content type='html'>&lt;div align="justify"&gt;Objective: I needed to use a PDF reader inside my windows application.&lt;br /&gt;&lt;br /&gt;Requirement of my App:&lt;br /&gt;&lt;br /&gt;1. Can't download the PDF files to the client computer&lt;br /&gt;2. Can't use Acrobat reader or any other plug in/reader (named Helper Applications) that push the user to download it .So everything should be embedded in my app and the user need not to have any plug-in or browser pre-installed to see and print the PDF files.&lt;br /&gt;&lt;br /&gt;Because the PDF file can not be downloaded to the user machine it is needed to navigate or to load the document into the reader giving to it an URL.&lt;br /&gt;&lt;br /&gt;Alternatives:&lt;br /&gt;&lt;br /&gt;1. Use the .Net WebBrowser control in my windows form and embed the reader or any PDF plug-in (not acrobat! it means I can not use the PDF Control that is include in VS when the acrobat reader is installed) into my Setup in order to install it unattended from the user. I never tried it!&lt;br /&gt;2. Use a third party PDF browser-reader control (dll or ocx). I never found it!&lt;/div&gt;&lt;div align="justify"&gt;3 Use a third party PDF reader control (dll or ocx) who is able to load PDF files from Memory Stream, URLs. I did it.&lt;br /&gt;&lt;br /&gt;Solution:&lt;br /&gt;&lt;br /&gt;I found a control “WPViewPDF” (an ocx) who is able to load a PDF from a stream and I implemented this method to get the stream from the URL:&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------&lt;br /&gt;//Make a Request to the file and return it as Stream&lt;br /&gt;WebRequest MyReq = WebRequest.Create(textBox1.Text);&lt;br /&gt;WebResponse MyResp = MyReq.GetResponse();&lt;br /&gt;Stream data = MyResp.GetResponseStream();&lt;br /&gt;&lt;br /&gt;//Create the bytes array store the Stream&lt;br /&gt;byte[] buff = new byte[MyResp.ContentLength];&lt;br /&gt;&lt;br /&gt;//Read the Stream and Load the array&lt;br /&gt;int len = 0;&lt;br /&gt;int cnt;&lt;br /&gt;do&lt;br /&gt;{&lt;br /&gt;cnt = data.Read(buff, len, buff.Length - len);&lt;br /&gt;len += cnt;&lt;br /&gt;} while (cnt &gt; 0);&lt;br /&gt;data.Close();&lt;br /&gt;MyResp.Close();&lt;br /&gt;&lt;br /&gt;//Recreate a Stream and pass it as a parameter&lt;br /&gt;MemoryStream ms = new MemoryStream(buff);&lt;br /&gt;pdfViewer1.LoadFromStream(ms); &lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;Note:&lt;/div&gt;&lt;div align="justify"&gt;Looking at this code I though What About if I want to save this info to a physical file?&lt;br /&gt;I researched and I found this:&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;1. The easiest way to Download the file and save it to disk is using a WebClient&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;WebClient client = new WebClient();&lt;br /&gt;client.DownloadFile(varURL, localFileName); &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt; &lt;/div&gt;&lt;div align="justify"&gt;2. But If I already have a MemoryStream and want to save it to a file, this is the way to go:&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;using (FileStream stream = new FileStream("fileName", FileMode.Create))&lt;br /&gt;using (BinaryWriter writer = new BinaryWriter(stream))&lt;br /&gt;{writer.Write(ms.ToArray());}&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;I used it!&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;-------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Conclusion so far:&lt;br /&gt;&lt;br /&gt;It works fine but the control does not render well the PDF file, so now I’m looking another control who can download a document from a stream. &lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;Finally!!!!!!!! I found a control which satisfies the requirement my application has. It is an assembly very ease to use. A reader-printer not a generator (We use PDFLib to generate the PDF documents on linux also work for Windows). PDFReaderControls.NET from Tall Component (&lt;a href="http://www.tallcomponents.com"&gt;www.tallcomponents.com&lt;/a&gt; ) a company from Netherlands, the license price $2500. UUUh!!&lt;br /&gt;&lt;br /&gt;I tried before those components:&lt;br /&gt;&lt;br /&gt;PDF-tools: It is an ocx and gave me to much exceptions.&lt;br /&gt;PDFXpress: They don’t have a release for .NET 2.0&lt;br /&gt;WPViewPDF: Does not render some PDF correctly.&lt;br /&gt;PDFNEtDemo: Does not load PDF from URLs&lt;br /&gt;&lt;br /&gt;There is also some exceptions that happen when PDF is used with .Net and the PDF document has not been done following the rfc2616 specification (www.ietf.org/rfc/rfc2616.txt) and it is loaded from the WEB (via URI):&lt;br /&gt;&lt;br /&gt;System.Net.WebException: The server committed a protocol violation. Section=ResponseStatusLine. A pain..!!&lt;br /&gt;&lt;br /&gt;To help the community and avoid people from waste time reading and reading I’m going to give some links that show the story of this exception and the solutions.&lt;br /&gt;&lt;br /&gt;Important to know:&lt;br /&gt;&lt;br /&gt;Some .NET requirements for PDF documents (&lt;a href="http://msdn2.microsoft.com/en-us/library/system.net.configuration.httpwebrequestelement.useunsafeheaderparsing(VS.80).aspx"&gt;http://msdn2.microsoft.com/en-us/library/system.net.configuration.httpwebrequestelement.useunsafeheaderparsing(VS.80).aspx&lt;/a&gt;)&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;1. To help protect from "HTTP Response splitting" attacks, parsing is performed according to the document that is named Request for Comments (RFC) 2616. This means that all control characters are not permitted in names or in values. For example, the carriage return (CR) character and the linefeed (LF) character are not permitted. There are other characters that are not permitted in names. Additionally, every response header must have a colon.&lt;br /&gt;2. Headers names should not have spaces in them.&lt;br /&gt;3. If multiple status lines exist, all additional status lines are treated as malformed header name/value pairs.&lt;br /&gt;4. The status line must have a status description, in addition to a status code.&lt;br /&gt;5. Header names cannot have non-ASCII chars in them. This validation is performed whether this property is set to true or false.&lt;br /&gt;&lt;br /&gt;Links to read about it:&lt;br /&gt;&lt;br /&gt;&lt;a href="http://blogs.msdn.com/mflasko/archive/2005/11/02/488370.aspx"&gt;http://blogs.msdn.com/mflasko/archive/2005/11/02/488370.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://support.microsoft.com/?kbid=888527"&gt;http://support.microsoft.com/?kbid=888527&lt;/a&gt;&lt;br /&gt;(search for "Undocumented bugs in the .NET Class Library (NCL)")&lt;br /&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/65ha8tzh.aspx"&gt;http://msdn2.microsoft.com/en-us/library/65ha8tzh.aspx&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.velocityreviews.com/forums/t302174-why-do-i-get-quotthe-server-committed-a-protocol-violationquot.html"&gt;http://www.velocityreviews.com/forums/t302174-why-do-i-get-quotthe-server-committed-a-protocol-violationquot.html&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-8469385921331168487?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/8469385921331168487/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=8469385921331168487' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/8469385921331168487'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/8469385921331168487'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2006/12/working-with-pdf.html' title='Working with PDFs'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-3507843693253077770</id><published>2006-11-20T07:06:00.000-08:00</published><updated>2007-01-18T13:30:48.976-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kenny Maita'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Removing URL from the footer of a printed document</title><content type='html'>&lt;div align="justify"&gt;&lt;strong&gt;It's kind of disappointed to know that There are some simple operations that still require the use of APIs and can't not be done entirely by using encapsulated .NET framework controls&lt;br /&gt;&lt;br /&gt;Well so far I have encountered this:&lt;br /&gt;&lt;br /&gt;To setup the header and footer when print a page (notice that I’m not talking about the header and footer of the webpage which can be solve using a PrintStyleSheet) I’m talking about the header and footer that appears in the Page Setup Dialog (you know the annoying URL)&lt;br /&gt;&lt;/strong&gt;&lt;br /&gt;I'm trying with the IE5. OCX control via interop that allows to pass a parameter for the header and footer of the pagesetup but I don’t want to go back using unmanage code.&lt;br /&gt;&lt;br /&gt;Also I found this solution that require to change the keys entries in the registry. Of course it is necessary to have permission to write in the registry. The basic code is this and needs no explanation&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------------&lt;br /&gt;using Microsoft.Win32;&lt;br /&gt;&lt;br /&gt;RegistryKey pageKey = Registry.CurrentUser.OpenSubKey("software\\microsoft\\internet explorer\\pagesetup", true);&lt;br /&gt;string newFooter = "";&lt;br /&gt;string newHeader = "";&lt;br /&gt;object currentFooter = pageKey.GetValue("footer");&lt;br /&gt;object currentHeader = pageKey.GetValue("header");&lt;br /&gt;pageKey.SetValue("footerTemp", currentFooter );&lt;br /&gt;pageKey.SetValue("headerTemp", currentHeader);&lt;br /&gt;pageKey.SetValue("footer", newFooter);&lt;br /&gt;pageKey.SetValue("header", newHeader);&lt;br /&gt;pageKey.Close();&lt;br /&gt;&lt;br /&gt;--------------------------------------------------------------------------------------------&lt;br /&gt;&lt;br /&gt;Something to remember:&lt;br /&gt;&lt;br /&gt;The header and footer entries in the registry maybe are not created yet in the user machine. Windows create those entries the first time the user accesses the PageSetup windows. So if you receive an exception maybe because the code is trying to read entries that are not created yet. You should check first.&lt;br /&gt;&lt;br /&gt;It was useful for me at the time I had a WebBrowser2.0 control running inside a windows form (VS2005 )so I could access the registry from my windows application. I have not use this code from a WebPage which require more code and some JavaScript to manipulate the registry but in this link is a sample showing it.&lt;br /&gt;&lt;br /&gt;http://www.codeproject.com/useritems/Removing_url_in_print.asp?df=100&amp;forumid=346298&amp;amp;select=1766196&amp;amp;msg=1766196&lt;br /&gt;&lt;br /&gt;Test it!! and let me know.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-3507843693253077770?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/3507843693253077770/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=3507843693253077770' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/3507843693253077770'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/3507843693253077770'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2006/11/removing-url-in-footer-of-printed.html' title='Removing URL from the footer of a printed document'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-8483765701703944801</id><published>2006-11-19T17:28:00.000-08:00</published><updated>2007-01-18T13:33:15.007-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kenny Maita'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Microsoft and Novell Announce Broad Collaboration on Windows and Linux Interoperability and Support</title><content type='html'>&lt;strong&gt;Hey.. That is money and more money for these companies. Windows and Linux control the computing world and each year companies require specialized people like us who are on the edge of technology. Shouldn’t we (Microsoft and Linux specialist --by the way we are like 5Millions in the entire world) be earning more money each year. Our brains are going to the same rhythm of this huge amount of information... Come on.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;img style="DISPLAY: block; MARGIN: 0px auto 10px; CURSOR: hand; TEXT-ALIGN: center" alt="" src="http://photos1.blogger.com/x/blogger2/5508/720212563293426/320/467985/11-02Ballmer-Hovsepian.jpg" border="0" /&gt;REDMOND, Wash., and WALTHAM, Mass. — Nov. 2, 2006 — Microsoft Corp. and Novell Inc. today announced a set of broad business and technical collaboration agreements to build, market and support a series of new solutions to make Novell and Microsoft® products work better together. The two companies also announced an agreement to provide each other’s customers with patent coverage for their respective products. These agreements will be in place until at least 2012. Under this new model, customers will realize unprecedented choice and flexibility through improved interoperability and manageability between Windows® and Linux.&lt;br /&gt;“They said it couldn’t be done. This is a new model and a true evolution of our relationship that we think customers will immediately find compelling because it delivers practical value by bringing two of their most important platform investments closer together,” said Steve Ballmer, CEO of Microsoft. “We’re excited to work with Novell, whose strengths include its heritage as a mixed-source company. Resolving our patent issues enables a combined focus on virtualization and Web services management to create new opportunities for our companies and our customers.”&lt;br /&gt;On-Demand Webcast&lt;br /&gt;You can view an on-demand Webcast of the News Conference with Microsoft CEO Steve Ballmer and Ron Hovsepian, president and CEO of Novell, held Nov. 2.&lt;br /&gt;&lt;a href="http://www.microsoft.com/winme/0611/28912/MS_Announcement_MBR.asx"&gt;View the Webcast&lt;/a&gt; (53 min. 34 sec.)&lt;br /&gt;Under the agreement, Novell is establishing clear leadership among Linux platform and open source software providers on interoperability for mixed-source environments. As a result, Microsoft will officially recommend SUSE Linux Enterprise for customers who want Windows and Linux solutions. Additionally, Microsoft will distribute coupons for SUSE Linux Enterprise Server maintenance and support, so that customers can benefit from the use of an interoperable version of Linux with patent coverage as well as the collaborative work between the two companies.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-8483765701703944801?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/8483765701703944801/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=8483765701703944801' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/8483765701703944801'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/8483765701703944801'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2006/11/microsoft-and-novell-announce-broad.html' title='Microsoft and Novell Announce Broad Collaboration on Windows and Linux Interoperability and Support'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5899981318499751300.post-8766986485688265693</id><published>2006-11-19T08:04:00.000-08:00</published><updated>2006-12-28T11:34:26.132-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Kenny Maita'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><title type='text'>Usign ORM</title><content type='html'>&lt;div align="justify"&gt;I use the software they mention here and It help me a lot!!&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;I copied this article from this link: Frans Bouma's blog &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;a class="singleposttitle" id="viewpost.ascx_TitleUrl" href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx"&gt;Solving the Data Access problem: to O/R map or not To O/R map&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;On the &lt;a href="http://www.asp.net/forums" target="_blank"&gt;http://www.asp.net/forums&lt;/a&gt; (the architecture section), a person asked in the '&lt;a href="http://www.asp.net/Forums/ShowPost.aspx?tabindex=1&amp;amp;PostID=651804" target="_blank"&gt;Your favorite O/R mapper&lt;/a&gt;' thread, why someone would use a 3rd party component for data-access and why would that be an O/R mapper and if so, which one?&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Q: why would I go out and buy a 3rd party component / library?&lt;br /&gt;&lt;br /&gt;A: With every task you have to perform during a software development project, you have to make a calculation: if I perform this task myself, how much time will that take, and given my hourly fee, how much money is involved in it, minus the knowledge I gain from doing it myself and the insight it gives me. The number resulting from that calculation is compared to what a 3rd party component costs + how much time it will take to get used to the 3rd party component + the time to figuring out which component is good + some risk calculation (because a 3rd party component can turn out to be a bad choice after all after a month or so). This sounds awkward, but it's common sense. It's not always more efficient to go out and buy a component to do things for you, like it's not always more efficient to do things yourself. However without making a simple calculation, it's hard to tell in which situation you're in. Software projects are hard to manage, and without tight cost control, or better: cost insight, it's hard to make a project be run efficient and profitable. So even if it's tempting to go out and buy a component or use an open source component, is it really more efficient to do so? Often it is, don't get me wrong on that, but don't forget the costs of using a 3rd party component, especially when it's a freebee without any documentation and just a raw example program without a lot of comments.&lt;br /&gt;&lt;br /&gt;Q: why should I implement an O/R Mapper in my projects?&lt;br /&gt;&lt;br /&gt;A: O/R mapping is in theory very simple: you have a table field and you have an entity field and you define a connection between them and use that connection in your logic to provide functionality like load a class' data, save it, etc. etc. However using solely the terms 'O/R mapping' and 'O/R mapper' is only making things more complicated. The problem description is:&lt;br /&gt;"I have to make a connection between my business logic and my persistent storage, how do I do that?".&lt;br /&gt;The answer: "use an O/R mapper" is not helpful, as it would require knowledge about what an O/R mapper is. If you don't know what it is, how can you judge if an O/R mapper is helpful and if that answer holds some truth? You can't. The right answer is a question: "how do I see my data?". It's the cornerstone of the answer leading to the solution of the dreaded Data-Access problem. There are a couple of different views on 'data' which result in different ways of how the DataAccess problem is solved. You have: 1) &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#tableapproach"&gt;table approach&lt;/a&gt; 2) &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;entity (Chen/Yourdon) approach&lt;/a&gt; 3) &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#domainmodelapproach"&gt;domain model (Fowler/Evans) approach&lt;/a&gt;(these are the top 3. There are others, most of them fall in either of these 3 categories though). 1) and 2) look the same, but aren't. Let's discuss these 3 views more in detail.&lt;a name="tableapproach"&gt;&lt;/a&gt;1) Table approachThe table approach is the plain 'I use tables and query them' approach. No theory used, just a set of tables, not based on any abstract model, they're created right there in DDL. The developer uses tables and is expecting to work with tables in memory as well, so a plain dataset/datatable approach with stored procedures or VS.NET-generated SQL statements is an appealing approach. Typically, the developers using this approach use terms like 'rows' and 'customer record'. It might sound odd, but this is a very widely used approach on .NET. The reasons for that are that Microsoft preaches it through VS.NET designers and -examples and because in the pre-.NET period, ADO with recordset objects was the way to go. &lt;a name="entityapproach"&gt;&lt;/a&gt;2) Entity (Chen / Yourdon) approachThe entity approach is different. The relational model is build with an abstract model and is based on theory. This means people speak of entities (or if you want to go really deep into theory, relation) and attributes. An approach with solely DataTables / DataSets is often not appealing, as the relational model speaks of Customer Entity and not about Customer record. Developers using this approach want to use these type of elements also in their code. As they use a relational model as their base of their thinking, the entities by definition don't contain behavior/rules or just low level behavior/rules, like the checkconstraints/unique constraints and other constraints defined like 'shippingdate &gt;=orderdate' or 'id &gt;=0'. Also important is the way the developers want to utilize the relational model. They understand that the data in the database is just data, and an entity is just a relation based on attributes, which can be constructed dynamically as well, with a select statement. This is important for lists of combined attributes from different entities and reporting functionality. The entity approach uses a combination of O/R mapping for the entity data and generic data functionality like Datasets / DataTables for the dynamic data retrieval requests. The entity approach is also widely used, you see it more in the larger applications as these applications often require a system architect and data analyst. It's proven technology which exists since the late '70-ies of the past century. &lt;a name="domainmodelapproach"&gt;&lt;/a&gt;3) Domain model (Fowler / Evans) approachThe Domain model is an approach which is the most used approach for solving the Data Access problem in the Java world, but interesting enough rather rare in the microsoft world. This is not that surprising, as in the Microsoft world it was simply unknown: Microsoft never talked about it, the techniques mostly used by the tools used by developers didn't support it very well, so running into it was not that common, only perhaps when you talked about Data Access with Java developers for example. Another reason it is not that widely used, is that it requires an OO approach which wasn't often possible with COM objects and/or VB5/6. The domain model focusses on domains, like the Customer domainor the Order domain. It starts with classes, like a Customer class, which contains the data for a customer but also all behavior for the customer, so all business rules for the customer are stored there. (This is somewhat simplistically said, there are a couple of variants of course, but for the sake of the argument, let's keep it with this description). Through inheritance you can create a compact model of classes and store the behavior you have to define in the class it belongs in, using polymorphism to override/modify behavior through the hierarchy. The classes / class hierarchy is then stored in a persistent storage, typically a database. This is a fundamental difference with &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;2)&lt;/a&gt; : with the Domain model, the relational model follows classes, classes don't follow the relational model. Typically, behavior in &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;2)&lt;/a&gt; (and also &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#tableapproach"&gt;1)&lt;/a&gt;) are stored in functionality objects like CustomerManager, which embeds the customer functionality, and which is applied to behaviorless entity objects. In &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#domainmodel"&gt;3)&lt;/a&gt; you have the behavior in the class, no manager classes. &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#domainmodelapproach"&gt;3)&lt;/a&gt; requires an O/R mapper to work with the data in the persistent storage or better: the O/R mapper is required to (re-)instantiate entity objects from their persistent state in the persistent storage. Because the system focus on data is through objects, working with data like in &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;2)&lt;/a&gt; and &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#tableapproach"&gt;1)&lt;/a&gt; is not available, it's working with objects. What's the best approach?Hard to say. 25 years of &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;2)&lt;/a&gt; in millions of software systems around the world can't be wrong, however millions of software systems in Java using approach &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#domainmodelapproach"&gt;3)&lt;/a&gt; can't be wrong either. I think it largely depends on what you think is more logical, how you want to work with data. I'm in camp &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;2)&lt;/a&gt;, and our product &lt;a href="http://www.llblgen.com/" target="_blank"&gt;LLBLGen Pro&lt;/a&gt; is a tool which tries to help with &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;2)&lt;/a&gt; by offering both O/R mapping and flexible relational model data access power. It's therefore not a pure O/R mapper as it doesn't fit that much in &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#domainmodelapproach"&gt;3)&lt;/a&gt;, it offers more functionality, to help with &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;2)&lt;/a&gt; than with &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#domainmodelapproach"&gt;3)&lt;/a&gt;. Also Paul Wilsons &lt;a href="http://www.ormapper.net/" target="_blank"&gt;WilsonORMapper&lt;/a&gt; is more of a category &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;2)&lt;/a&gt; than category &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#domainmodelapproach"&gt;3)&lt;/a&gt; application. More pure O/R mappers, like &lt;a href="http://www.thona-consulting.com/" target="_blank"&gt;EntityBroker&lt;/a&gt;, &lt;a href="http://www.x-tensive.com/" target="_blank"&gt;DataObjects.NET&lt;/a&gt;, NHibernate and others focus on &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#domainmodelapproach"&gt;3)&lt;/a&gt; (most of the time). Don't think lightly about this, the differences are fundamental and will influence how your system structure is designed for a great deal. So it's important to pick the approach which fits your way of thinking. To test how you think about data, ask yourself: "A customer gets the Gold status when the customer has bought at least 25,000$ worth of goods in one month. Where is that logic placed? in which class/classes?". Inside the Customer object, reading inside the customer object order data to test the rule? Or in a CustomerManager which executes rules and consumes customer and order objects? Also don't let your decision be influenced by "but this example proves x is better than y!": at the end of the day, data is data and not information. Information is data placed into context, and it requires interpretation to give it any value/meaning. How you do that is not important, as long as you meet requirements as: maintainability, scalability and efficiency in development, deployment and perhaps (but not necessarily) performance. So if your way of writing software is clearly in the Fowler/Evans camp, &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#domainmodelapproach"&gt;3)&lt;/a&gt;, don't use datasets, don't use a Data Access solution targeting &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;2)&lt;/a&gt; because it will be a struggle: the way of thinking doesn't fit the tool used: you want to drive in a nail with a screwdriver, you should either switch the nail with a screw or use a hammer instead of a screwdriver. So if you're in camp &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#domainmodelapproach"&gt;3)&lt;/a&gt;, use a pure O/R mapper, it will fit like a glove. If your way of thinking is clearly in the &lt;a href="http://weblogs.asp.net/fbouma/archive/2004/10/09/240225.aspx#entityapproach"&gt;2)&lt;/a&gt; camp, using a pure O/R mapper can give you headaches when you want to write a lot of reports, you want to use a lot of lists combined from attributes of multiple entities, you need functionality which allows you to perform scalar queries, and an approach which allows you to think from the relational model, so an application which has an approach tailored on starting with the relational model.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/5899981318499751300-8766986485688265693?l=kennymaita.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://kennymaita.blogspot.com/feeds/8766986485688265693/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=5899981318499751300&amp;postID=8766986485688265693' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/8766986485688265693'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5899981318499751300/posts/default/8766986485688265693'/><link rel='alternate' type='text/html' href='http://kennymaita.blogspot.com/2006/11/solving-data-access-problem-to-or-map.html' title='Usign ORM'/><author><name>Kenny Maita</name><uri>http://www.blogger.com/profile/14348138777477514728</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='32' height='24' src='http://4.bp.blogspot.com/_a774CGO4xa4/SM6UDZ4aJOI/AAAAAAAAH00/J2ynrd9iO-4/S220/DSC04865.jpg'/></author><thr:total>1</thr:total></entry></feed>
