Introducing Windows Azure- P12:The cloud platform is getting more and more attractive to the computing world. Today, service-oriented architecture (SOA) and aspect-oriented programming (AOP) techniques are widely used in enterprise solutions. A question an IT management team or a software development team may ask is, what is the next trend going to be? Cloud computing seems to be the right answer. | CHAPTER 2 ACCESS CLOUD TABLE STORAGE TableContext Abstract Class -b TableStorageDataServiceCont. t Properties J TableName S Methods V Tablecontext ---------- A ----------------- AddressTableContext I Class -b TableContext Ei Properties 21 AddressTable Ei Methods W AddressTableCont t Figure 2-2. TheAddressTableContext class diagram 3. Add a new class called AddressTableContext to inherit from the base class TableContext as shown in Listing 2-3. The purpose of creating this class is to encapsulate the table storage interface function to a specific data table. In this exercise we only access the Address table so we only need to create one derived class from TableContext. If there are multiple tables we need to access then we need to create more classes derived from TableContext in the future. Each derived class is dedicated to a specific data table. So why can t we come up with a generic table-access class which exposes the data table access functions and returns generic types. The answer is the table name is a static string and needs to match the name of the physical data storage table. Another reason is that this allows the client code to accept the return data table type as a concerte type without transforming the generic type. This will significantly reduce unnecessary complexity. To reach that end there are three tasks that need to be done. 1. Create a constructor to this class to accept a parameter of instance of StorageAccountInfo. 2. Read the table name from the configuration settings in the body of the constructor. 3. Add a query interface to query the Address table. 28 CHAPTER 2 ACCESS CLOUD TABLE STORAGE Listing 2-3. Implementation of Class AddressTableContext a Derived Class of TableContext using System using using using using namespace CloudTableStorageService using using CloudTableStorageService .