324 ❘
CHAPTER 15 Using ironPython from other .net LangUages
USINg IRoNPyTHoN CoNSTRUCTIvEly This chapter has demonstrated how to access an IronPython module from C# or Visual Basic.NET.
All this work may seem counterproductive, but you really can gain a lot from using this approach.
Not only can you create extremely fast and flexible IronPython modules to perform tasks such as
list processing, but you gain the user interface development flexibility offered by both C# and Visual
Basic.NET. The one essential concept you should take from this chapter is that using multiple lan-
guages in an application to gain access to the best features of each language nets considerable flex-
ibility and development speed once you overcome the initial development hurdles.
There isn’t any way that a single chapter of a book can address every possible need for every possible
reader. However, before this technology becomes real to you, you have to see it do something that
you couldn’t ordinarily do with ease in your development environment. Before you move on to the
next chapter, consider creating a list of applications that could benefit from a combined IronPython
and C# or Visual Basic.NET approach. Try creating examples that exemplify key features of these
applications. As you gain experience using IronPython with the .NET languages you use now, you’ll
begin to understand why using multiple language tools is so beneficial. The important thing is to try
more than just the one example in this chapter.
So far you’ve used .NET from IronPython and IronPython from a .NET static language. There’s a
third relationship that you need to try before you can consider your essential IronPython experi-
ence complete — extending IronPython using another language. Chapters 16 and 17 show how to
create extensions for IronPython so that you can begin building special libraries that enhance basic
IronPython functionality. For example, you might create a basic library of dialog boxes to use with
IronPython and overcome that user interface problem (at least partially). Chapter 16 discusses C#
extensions, while Chapter 17 discusses Visual Basic.NET extensions. Interestingly enough, the two
languages require a slightly different approach when extending IronPython; it pays to read both
chapters so you can see the full range of extension requirements.
548592c15.indd 324
2/25/10 9:45:57 AM
www.finebook.ir