January 5, 2002

Scalable Architectural Guidelines: Designing for Flexibility

am frequently asked the following question,”Should I be using stateless or stateful components for scalability?” My answer is invariably an emphatic “Yes!” What I mean by this, is that both stateless and stateful components have a legitimate role in any scalable system architecture. This applies equally to both Client Server

Locale-aware string conversions

You can use the usual UCase, LCase, and StrConv functions to convert a string to upper, lower, and titlecase (e.g. “This Is A Title”). However, VB.NET offers is much more flexible, and lets you convert the case of a string according the locale you specify. You can do this through

Weekday names in any language

The System.Globalization.CultureInfo object exposes two properties, NumberFormat and DateTimeFormat, which return information about how numbers and dates are formatted according to a given locale. For example, consider this code: ‘ How do you spell “Sunday” in German?’ First, create a CultureInfo object for German/Germany.’ (Note that you must pass a

Trimming strings

Visual Basic .NET strings expose three trim methods: TrimStart, TrimEnd, and Trim – which trim one or more characters from the beginning, the end, or both the beginning and end of the string. They therefore work like VB6’s LTrim, RTrim, and Trim functions, with an important difference: you can decide

Iterating over the characters in a string

Visual Basic .NET strings support the For Each statement, so you can iterate over each individual character as follows: Dim s As String = “ABCDE”Dim c As CharFor Each c In s Console.Write(c & “.”) ‘ => A.B.C.D.E.Next However, you should bear in mind that For Each loops on string

Reducing string memory usage with the Intern method

A .NET application can optimize string management by maintaining an internal pool of string values known as intern pool. If the value being assigned to a string variable coincides with one of the strings already in the intern pool, no additional memory is created and the variable receives the address

Process string faster with the StringBuilder class

You can think of a StringBuilder object as a buffer that can contain a string with the ability to grow from zero characters to the buffer’s current capacity. Until you exceed that capacity, the string is assembled in the buffer and no object is allocated or released. If the string

An Improved escape() Function in Javascript

Currently Javascript’s escape() has some limitations. For instance, if you want to pass a+b not a b, you want to get the literal “+” in the server side. Javascript’s escape function does not replace the “+” with a hexadecimal value, so when it is received on the server, it will

Inserting Explicit Values into Identity Columns in T-SQL

The IDENTITY_INSERT property allows explicit values into the identity column of a table. Only one session at a time is allowed to have the IDENTITY_INSERT property set to ON. If the value inserted is larger than the current identity value for the table, SQL Server automatically uses the new inserted

No more posts to show