What should you do?
You are an enterprise application developer. You are implementing a new component for an application. The component accesses a database to populate a list of customer objects and exposes a method that is named GetAllCustomers. The component uses a design pattern to access the database only on an as-needed basis. A caching mechanism exists in a lower tier of the application architecture. The component must not cache data. You need to implement the logic for populating a list of customer objects by using a database query. You also need to ensure that you meet the company guidelines for the component design pattern. What should you do?
What should you recommend?
You create Web-based client applications.
You are designing a database that must meet the following requirements:
Store data about people in the People table and data about the companies they work for in the Companies table.
Track an unlimited number of companies for a person.
Track an unlimited number of persons who worked at each company. You decide to create a one-to-many link from the People table to the Companies table. You need to evaluate whether the database is designed effectively and make a recommendation, if required. What should you recommend?
Which two actions should you perform?
You are creating a custom user control. The custom user control will be used on 10 Web Forms for an ASP.NET Web site that allows users to register and log on to a personalized experience. The custom user control uses two TextBox controls and two Button controls. You need to ensure that the controls are visible only when users are not logged on to the Web site. You also need to minimize the amount of effort in development and maintenance for the Web site.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
Which class should you implement?
You have a Publishing site. You customize the default edit page toolbar. You need to add a new button to the toolbar.
Which class should you implement?
What should you do?
You are an enterprise application developer. You design a data access component that interacts with a Microsoft SQL Server database. The component uses a database connection string. The database connection string is stored in clear text in the ConnectionStrings section of the application configuration file. During testing, you discover that the component might be vulnerable
to SQL injection attacks. You need to adopt a strategy to protect the component from SQL injection attacks. What should you do?
Which line of code should replace the code on line 09 of the unit test?
You create Web-based applications. You are creating an Internet banking application. You write the following lines of code to represent a method in your application. (Line numbers are included for reference only.)
01 public void Transfer(decimal amount, BankAccount account) 02 {
03 if (!(amount > 0))
04 throw new Exception(“Invalid deposit amount!”);
05 else
06 {
07 this.Withdraw(amount);
08 account.Deposit(amount);
09 }
10 }
You use the Microsoft Visual Studio 2005 test feature to automatically generate the following unit test.
(Line numbers are included for reference only.)
01 [TestMethod()]
02 public void TransferTest()
03 {
05 BankAccount target = new BankAccount();
06 BankAccount transferTo = new BankAccount();
07 target.Deposit(500);
08 target.Transfer(100,transferTo);
09 Assert.Inconclusive(“A method that does not return a value cannot be verified.”); 10 }
You need to change the test method to return a conclusive result. Which line of code should replace the code on line 09 of the unit test?
Which code segment should you use?
You create a Microsoft WinForms application that allows you to search within a Microsoft Office SharePoint Server 2007 site collection.
You write the following code segment.
SPSSearchWS.QueryService searchWS = new
SPSSearchWS.QueryService();
string query = “My_Query”;
You need to bind a DataGridView control directly to a query result set.
Which code segment should you use?
What should you include in the Product class?
You create Web-based client applications. You are creating a class library that will be used by an e-commerce Web-based application. The library has an abstract class that is named Product. The Product class serves as a base class for the other classes and provides a default ProductID property. Each class other than the base class represents a type of product that is sold by your company. There is a ProductID property and a GetProductDetails procedure for each product type.
You need to ensure that the application meets the following requirements:
The shopping cart in your Web-based application processes all product types in the same manner.
Each class retrieves its data from a different source.
The GetProductDetails procedure retrieves the data from the appropriate source for the product type.
What should you include in the Product class?
Which two actions should you perform?
You create a Microsoft Office SharePoint Server 2007 site.
You are creating a custom field control that displays a video.
The custom field must perform the following tasks:
Render the control properly when the page is in display mode.
Enable a user to select an appropriate video for display when the page is in edit mode.
You need to ensure that the custom field meets the outlined requirements.
Which two actions should you perform? (Each correct answer presents part of the solution. Choose two.)
Which option should you use?
You create Web-based client applications. You are creating a component that sends the data that is generated by regional offices to a remote server that is located at the central office. Each regional office generates thousands of orders every week. This data is stored on several tables in an instance of Microsoft SQL Server that is located at the regional office. The manager at the regional office reviews all orders and modifies them, if necessary, before inserting them into the database at the central office.
You need to ensure that the component meets the following requirements:
The manager has the option of reviewing and modifying the orders offline. The data from a regional office is copied to the server that is located at the central office in as short a time as possible.
Which option should you use?