O'Reilly logo

C# for Financial Markets by Andrea Germani, Daniel J. Duffy

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

11

Interoperability: Namespaces, Assemblies and C++/CLI

11.1 INTRODUCTION AND OBJECTIVES

In this chapter we introduce a number of techniques to help developers organise their code and projects. The first ten chapters focused on language features, some design patterns and examples. When developing medium and large applications we shall need tools to organise our code base. In a sense the contents of this chapter are closely related to system management of applications. To this end, we discuss the following topics:

  • Grouping classes into logically related namespaces.
  • Designing and implementing software using assemblies and DLLs.
  • Creating C# projects; multi-DLL projects.
  • Attributes and the AssemblyInfo.cs file.
  • Discovering assembly contents at run-time using the Reflection application programming interface.

This chapter can be read and used as a reference. In particular, the functionality in .NET allows developers to design and implement flexible component-based software systems. We consider many of the techniques in this chapter to be important when designing and implementing complex C# applications. We shall use them in future chapters when developing fixed income applications. In Chapters 20 to 23 we discuss the issue of C# and Excel interoperability.

11.2 NAMESPACES

In general, a namespace is a collection of logically related types. One immediate advantage of using namespaces is that we avoid name collisions – it is possible to define two namespaces, each one containing a class ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required