CD5480 - Component Technologies, 5 credits

.NET Exercise 1 - Introduction to Winforms With C#

1.1 Overview 1.2 Goals: Understand solutions and projects in Visual Studio. Understand and be able to use Windows Forms to create simple window based applications in .NET using C# Implement event handlers for built in controls.

1.3 Requirements Must have Visual Studio.NET and the .NET framework installed on the machine. Does not require web components to be installed nor the IIS server.

1.4 Prerequisites Working knowledge of C++/Java or C#

1.5 Examination You should be able to explain all parts of your produced software. The application should be zipped and sent to the lab-teacher together with your ID (YYYYMMDDXXXX) and name. You are allowed to be maximum two persons in each group for the .NET exercises. Both must know and be able to answer questions on all parts of the produced software.

1-1

CD5480 - Component Technologies, 5 credits

1.6 Exercise 1.6.1 Functional Description The application you should produce should have a simple user interface depicted below. When the user clicks the different buttons, the label text (to the right) should change into what you see in the picture below. Note that it should be possible to cut and paste the text from the labels.

Figure 1.1 Application before and after clicking the three buttons and finally, resize.

The functionality of the three buttons will be extended during the remaining exercises. Notice that the controls containing the text should be resized together with the application form.

1-2

Course CD5480 - Component Technologies, 5 credits

.NET Exercise 2 Interfaces and Private Assemblies

2.1 Overview 2.1.1 Goal: Be able to create and implement an interface, using C# Be able to create shared interface assemblies. Understand and be able to explain strong names and GAC. Be able to add a strong name to the interface and put it in the GAC. Be able to explain and use private assemblies.

2.1.2 Requirements Exercise 1 finished

2.1.3 Examination Examination as in exercise 1. You should produce the following deliverables: q

An assembly that provides a common interface for the successive exercises

q

A private assembly that implements that common interface

1-3

CD5480 - Component Technologies, 5 credits

2.2 Exercise 2.3 Functional Description 2.3.1 Interface The interface should be named ImyOwnInterface and should expose one property (read/write) myValue and one method GetAndIncrement. The interface should be compiled into its own (global) assembly. This assembly should be given a strong name.

2.3.2 Component The component should implement the interface (ImyOwnInterface) and be put in a private assembly. The component should be named myPrivateComponent

2.3.3 The application from Exercise 1 Modify the application from exercise 1 to make use of the new component when the user clicks “GetValue Private” The value in the component should be increased each time the user clicks the button.

1-4

Course CD5480 - Component Technologies, 5 credits

.NET Exercise 3 Private Assemblies

3.1 Overview 3.1.1 Goal: Be able to explain the differences between private and shared assemblies. Be able to create a shared assembly with one component, implementing the exercise interface. Access (and use) the shared assembly from the application in exercise 1.

3.1.2 Requirements Exercise 1 and 2 finished.

3.1.3 Examination Examination as in exercise 1. You should produce the following deliverables: q

A Shared assembly with one component implementing the exercise interface. (The same work as in “Component” in exercise two, but the result should be assigned a strong name and be put in a shared assembly).

q

A modified client (from exercise 1) that uses the shared assembly from this exercise when the user clicks the “GetValue Shared” button. The value in the component should be increased each time the user clicks the button.

1-5

CD5480 - Component Technologies, 5 credits

.NET Exercise 4 Web Services

4.1 Overview 4.1.1 Goal: Understand .NET web services. Understand how to treat different entities of an interface. Be able to implement a web service with a given interface.

4.1.2 Requirements Exercise 1,2,3 Access to an IIS server with .NET installed.

4.1.3 Examination Examination as in exercise 1. You should produce the following deliverables:

1-6

q

A web service implementing the same functionality of the interface.

q

A modified client (from exercise 1) that accesses the web service to obtain the value when clicking “GetValue Web”. The value in the component should be increased each time the user clicks the button.

Course CD5480 - Component Technologies, 5 credits

.NET Exercise 5 Web Forms

5.1 Overview 5.1.1 Goal: Create a web client using web forms to access lab 2,3,4

5.1.2 Requirements Exercise 2,3,4 finished Access to an IIS server with .NET installed.

5.1.3 Examination Examination as in exercise 1. You should produce the following deliverables: q

A web client that can access all types of assemblies and web services The functionality of the web client should be the same as the resulting Win Form client from exercises 1 through 4, but should be implemented with Web forms instead.

1-7