AussieALF Blog
Do you bloat your app?
As with all applications we have to take performance into account, part of our performance is storage/memory used for operations.
OK so I am not an all time guru and know everything, however I do know that for each data type within our applications we have to make informed decisions on what data types we will use. When dealling with XPO this is especially important as the data type we use within our application will ultimately end up choosing the type of data type in our database which will determine how much storage space is used and how well the database will perform.
As an example of how things can go wrong, recently I found an awesome code WTF in a Legacy database system I inherited. The Tax Rate is being stored as a Currency which the XPO Wizard has defined as a Decimal... now a Tax Rate is usually a nice small number such as 0.1 (10%) or say 0.11 (11%), again as stated I am not a guru so I did a quick search on Single Double Decimal to see what the difference is... I was shocked.
I found this blog post which is a great simple to the point explanation on what is what. http://techembassy.blogspot.com/2006/07/data-types-single-double-and-decimal.html and if you want some indepth information on Floating Points I recommend this http://www.extremeoptimization.com/resources/Articles/FPDotNetConceptsAndFormats.aspx
So this is basically telling us that a Single is a 32bit type, Double is 64bit and Decimal is 128bit. So if we consider the second article I linked, the "accuracy" of my tax rate only has to be to about 2 decimal places or a "precision" of 3 digits. Currently we have a Decimal defined so for this "small" number we are using 128bits (16 bytes) to store the Tax Rate, which when we look at a Transaction Table which should always store the "Rate" that was used to calculate it's sell price we end up with "ALOT" of bloat.
So in conclusion a Data Type of Single(Float) would do perfectly for my Tax Rate, but say for the Unit Sell Price which is the calculation of (CostPrice * Tax Rate) you might want to store it with higher precision, so a Double would be most likley more than "accurate" enough and you would have saved 1/2 the memory over a Decimal.
So I ask you, do you bloat your app?
Microsoft JET SQL Reference
I keep bloody getting caught out trying to remember what applies to Access and what doesn’t. This article is handy for structuring SQL statements for creation and altering of the DB structure.
http://msdn.microsoft.com/en-us/library/aa140015(office.10).aspx
I figured I would post it here so I don’t lose the link ;) although Google is a good tech sometimes it comes in handy to keep a list of handy stuff ;)
Simple XPO Template for XPOSync bug
Until the XPOSync for Simplified Criteria bug is fixed for collections, I have been using a small template to quickly allow me to “Re-enter” the property after a sync.
Obviously this is only going to work if you use the Manual Sync method (which I strongly recommend anyway for performance), if you are not sure what I mean by Manual Sync please look on my blog about setting up Simplified Criteria Syntax, I show how to setup a shortcut key for it.
Anyways just go into your DevExpress > Options… > Templates, add a new template (I used xsc) then enter this
Then all I did is for the “use” is “In Class”.
So my workflow is basically, CTRL+1 to perform a manual XPO sync, then when the VS errors get listed I just head to the FieldsClass and add whatever fields are “erroring” then move on. :)
Just thought I would share this quickly while I was using it.
CodeRush Is Your Best Friend for XPO
Recently Gary Short burnt a little too much midnight oil and ended up posting a blog with some incorrect property patterns for XPO. These have been corrected but it did make me wonder how many people are actually using the CodeRush templates for XPO.
So I decided to do up a quick blog to highlight some of the “cool” features of CodeRush with XPO. First thing to remember is that CodeRush is language independent, it is smart and knows how to code as a C# or VB.NET programmer, so if you enjoy your hieroglyphic bracket hell {C#} or prefer to program in English (VB.NET) CodeRush will provide the code that you need.
Note: CodeRush will automatically put in the project reference to DevExpress libraries as well as a using/Imports statement as well :)
Jeez that was painful, I think my new blog is up and running
I think I have transferred everything across… let us know if there is anything missing.
I am working on “enabling” comments, cause I don’t think that is “working” at the moment.
EDIT: Got comments working :) sweet
Other than that it is all up. Enjoy
More Articles...
- Something new for XPO v9.3, Free Joins
- New Blog Site
- Woohoo I am apart of the DevExpress DX-Squad
- XPO Simplified Criteria Syntax explained (part 1)
- Simple binding using DevExpress XtraEditors and XPO Simplified Criteria Syntax
- XPO Simplified Criteria Syntax
- RemoXPO – My adaptation of DevExpress Oliver Sturm’s XPO Publication Service
- DevExpress XPO and .NET Remoting, a perfect match
- Thanks to DevExpress CodeRush CodeIssues it has taught me a simplified initiation of object
- Nice, Simple XtraReport to HTML Email embedding IMG resources code
- My XtraLookupEdit, allows you to bind a DisplayValue and EditValue
- Is WinForms the Dinosaur of Programming?
Latest Comments
- RemoXPO – My adaptat...
Funny you should mention that, in my par... More...
09-Mar-10 - RemoXPO – My adaptat...
Hi, did you consider migrating from Remo... More...
09-Mar-10 - RemoXPO – My adaptat...
Thanks for this, using it in a commercia... More...
09-Mar-10 - RemoXPO – My adaptat...
Thanks Aussie, very handy. More...
02-Mar-10 - RemoXPO – My adaptat...
Hi, I'm newbie in Devexpress products, c... More...
01-Mar-10





