The document discusses creating components in .NET. It defines what a component is, the architecture of components in .NET including assemblies and the global assembly cache. It also covers implementing interfaces, polymorphism, and using COM components in .NET.
Download as PPS, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
652 views
VB .Net Tutorial - 13
The document discusses creating components in .NET. It defines what a component is, the architecture of components in .NET including assemblies and the global assembly cache. It also covers implementing interfaces, polymorphism, and using COM components in .NET.
Download as PPS, PDF, TXT or read online on Scribd
You are on page 1/ 19
Creating Components
Objectives In this lesson, you will learn to: ☛Create components for Windows Forms ☛Use COM components in Visual Basic .NET ☛Implement an Interface in Visual Basic .NET
Creating Components Component ☛Is a reusable piece of code in a binary form that can be plugged into components from other vendors, with relatively little effort. ☛Helps in reducing the development time. ☛Helps in reducing errors because you reuse a code that is already tested.
Creating Components Just a Minute… You need to write a program to validate user logins. This program will be used across applications. What will you develop the program as and why?
Creating Components Component Architecture in .NET ☛Assembly ✓ Contains information about the files on which the component depends and the location of these files. ✓ Consists of a manifest and the portable executables (PE). ☛Global Assembly Cache ✓ Is a repository of assemblies. ✓ Must have a unique identification to resolve name conflicts. To avoid this conflict you can also give a shared name to an assembly.
Creating Components Component Classes ☛Get created when they follow defined standards of interaction provided by the IComponent interface. ☛Can be created by using the .NET Class Library project template. ☛Can be used in another project by adding a reference to the components.
Creating Components COM in .NET ☛.NET supports COM and ActiveX objects for backward compatibility. ☛Interaction between COM and .NET is provided through a wrapper called Runtime‑Callable Wrapper (RCW). ☛A COM component can be called from .NET in the following ways: ✓ By converting the COM type library to a .NET assembly by using the tlbimp tool ✓ Using COM components directly by adding a reference
Creating Components Problem Statement 13.D.1 Customers of Diaz Telecommunications who place their orders online must submit their credit card number, name, and the expiry date of the credit card. The credit card number submitted has to be validated.
Creating Components Task List ☛Identify the most suitable type of component. ☛Identify the properties and methods for the component. ☛Create a project of the appropriate type. ☛Add properties and functions to the component. ☛Build the component. ☛Create a user interface to display the result. ☛Verify the execution.
Creating Components Task 1: Identify the most suitable type of component. Result: ☛A customized component has to be created to verify the credit card numbers supplied by the customers.
Creating Components Task 2: Identify the properties and methods for the component. ☛You can have the following types of constructors in your component: ✓ Public Constructors — To enable developers to create instances of your component. ✓ Friend Constructors — To enable the usage of a component inside an assembly but not outside it. ✓ Private Constructors — To enable the usage only inside the component class.
Creating Components Task 2: Identify the properties and methods for the component. (Contd.) Result: ☛The two properties required for the components are: CustomerName: A property for the name of the customer of type string. CardNumber: A property for the card number of type string. ☛The following methods are required: The default public constructor can be used for this component. LeftChar(): A method to return the leftmost character from a string.
Creating Components Task 2: Identify the properties and methods for the component. (Contd.) Result: ☛RightChar(): A method to return the rightmost character from a string. ☛CharaceterToInt(): A method to return the numerical equivalent of a character. ☛Validate(): A method to validate the card number.
Creating Components Task 3: Create a project of the appropriate type. Task 4: Add properties and functions to the component. Task 5: Build the component. Task 6: Create a user interface to display the result. Task 7: Verify the execution.
Creating Components Problem Statement 13.P.1 The Employee data in the call centers at Diaz Telecommunications requires check for valid employee id, age, and salary entries. The employee id should start with the letter ‘E’ followed by three digits. The age should be from 21 years to 60 years. In addition, the salary should be in the range of $3000 to $35000. Create a component that will check the validity of employee id, age, and salary.
Implementing Reverse Engineering: The Real Practice of X86 Internals, Code Calling Conventions, Ransomware Decryption, Application Cracking, Assembly Language, ... Open Source Tools (English Edition) Jitender Narula 2024 scribd download
Implementing Reverse Engineering: The Real Practice of X86 Internals, Code Calling Conventions, Ransomware Decryption, Application Cracking, Assembly Language, ... Open Source Tools (English Edition) Jitender Narula 2024 scribd download