Part I: Design Strategies AL Chapter 1: Defining the Language Environment TE Chapter 3: Defining a Design Strategy RI Chapter 2: Understanding the Application Lifecycle MA Chapter 4: Designing the User Interface D Chapter 5: Designing with Speed in Mind GH TE Chapter 6: Designing with Reliability in Mind CO PY RI Chapter 7: Designing with Security in Mind
Defining the Language Environment Most professional programmers use more than one programming language. A programmer who relies on a single language for every task is like a carpenter who treats everything as a nail. Just as carpenters use a particular fastener for a specific need, programmers rely on programming languages that suit an individual development need. This chapter approaches the use of a particular programming language to meet a specific need in a development environment.
Part I: Design Strategies Defining the Design Strategy Elements It’s natural to say at the outset of a project that you want to accomplish a particular task. You don’t know how you’ll accomplish it at this point, but simply that you plan to accomplish it. Before you can define a language environment, you have to have some idea of what you want to accomplish. In many cases, you need to consider some rudimentary steps to accomplish your goal as well.
Chapter 1: Defining the Language Environment Considering the C # Language This book is about using the C# language to develop applications of various types. You’ll work through the particulars of designing an application that relies on C# as its main language. C# is a great language for many uses. For example, it’s possibly the best language that Microsoft makes available for developing applications that use a combination of native code and managed libraries.
Part I: Design Strategies http://www.softsteel.co.uk/tutorials/cSharp/lesson2.html and http://blogs.msdn.com/ ericgu/archive/2005/01/26/360879.aspx): ❑ Both languages compile into machine-independent byte code that runs in a managed environment. Although the .NET Framework runs exclusively on Windows today, you can run the C# Intermediate Language (IL) code on other platforms such as Linux using alternative environments such as Mono (http://www.mono-project.com/Main_Page).
Chapter 1: Defining the Language Environment Unfortunately, you still have the vast array of native-code applications to consider when designing your applications. You may need to access Windows directly to perform some tasks or work with an older DLL where pointer manipulation is required. When you encounter this situation, you have two choices. You could wrap the code you need in a C++ DLL and make it available to your applications using P/Invoke in a manner that doesn’t require the use of unsafe code.
Part I: Design Strategies Anonymous methods make it possible to create applications that run faster and require less code as well. An anonymous method is literally a method that has no name. The method appears in-line in place of the usual method reference. Using anonymous methods can also make it easier to debug the code because the code appears in-line where the developer can easily see it during a debugging session. In some cases, you want to place an interface definition in multiple files.
Chapter 1: Defining the Language Environment Code Reliability Concerns When you add the power to work with unsafe code to any language, you also make it possible for the developer to create unreliable code. The low-level functionality that makes C# attractive also makes it a dangerous tool in the wrong hands. A developer needs to know how pointers work before using them in a production environment.
Part I: Design Strategies Visual Basic provides a convenience item not found in C#. You receive automatic wire-up of events with event handlers using the handlers construct. Although this is a small feature, it does improve developer efficiency and makes it possible to see the wire-up in the same place that the event handler appears.
Chapter 1: Defining the Language Environment Using F# In many cases, you need to work with data in new ways in today’s applications. For example, most systems today come with multiple processors, but most programming languages don’t use this capability very well. F# is a new language that joins other functional languages such as ML (http:// en.wikipedia.org/wiki/ML_programming_language), OCaml (http://caml.inria.fr/), and Haskell (http://www.haskell.org/).
Part I: Design Strategies Inventorying Your Tools You’ve probably collected a host of tools while working on various applications. The problem for most developers isn’t a lack of tools — it’s more likely too many tools. In fact, you may not even know which tools you have available. Because the tools you use affect the language environment, it’s important to choose the right tools.
Chapter 1: Defining the Language Environment The human resources for your project are further affected by biases, preference for particular tools, and the desire to make their mark on the project. The following sections provide an overview of the resources you need to consider as part of the language environment. The remainder of the book provides additional details on this topic as appropriate.
Part I: Design Strategies Understanding the Significance of Experience Unless your team members are joined at the hip, they’ve had different development experiences. A development experience helps shape the way the team member views a particular application development requirement and may help you achieve a better result.
Chapter 1: Defining the Language Environment Of course, resources come in a number of forms. It’s possible for a project to move along fine until it requires something special. You may need special graphics files to test your application. Unless you schedule the artist’s time well in advance, the images may not be ready when you need them. The same holds true for any specialized need.