Financial Daily from THE HINDU group of publications
Monday, May 05, 2003

Mentor
Features
Stocks
Port Info
Archives

Group Sites

Mentor - Books
Columns - Reading Room


The sharp edge of Java

WHAT is J# (read Java Sharp)? John Sharp, who has authored the book Microsoft Visual J# .NET, wonders in the intro whether Microsoft named the product after him, but "sadly that's not the case". J# is not Java. It is a programming language that uses Java syntax so that Java developers can build applications with the Microsoft .NET Framework.

The book assumes familiarity with the syntax and semantics of the Java language and proceeds to describe how to build enterprise applications in a .NET environment using J# and Microsoft Visual Studio .NET. More:

  • Role-based security is used to specify who can execute your code. A .NET component can tag classes and methods declaratively, stating the identity and/or roles that can execute the code. If the user running the code does not meet these requirements, the result is a SecurityException.

  • An attribute is a piece of declarative information that is stored with the metadata of a type. At run time, this metadata can be examined and used to modify the way in which the type operates. The .NET Framework defines a large number of attributes. Most cause annotations to be inserted into the compiled code and are interpreted by the common language runtime.

  • You might have many reasons for needing to transform XML in one dialect to XML in another dialect in your application. For example, you might be part of a supply chain in which orders are passed in XML format from customers to suppliers. Or you might have dozens of files containing medical records that must be converted to a common format.

  • A producer is an object that creates resources. A consumer is an object that obtains resources from a producer. A simple producer might implement an iterative process, creating one resource after another. A consumer will wait until a resource is ready, and then retrieve it from the producer and exercise it in some way. When the consumer has finished, it will wait for the next resource to become available, and so on.

  • Web services are among the hottest topics in the software industry because they promise interoperability between heterogeneous systems through a commonly accepted set of standards that govern the layout and transportation of data. Web services also provide the foundation for the Global XML Web Services Architecture (GXA).

  • Message transformation is achieved using `channel sinks'. The purpose of a channel sink is to examine the message object passed in, process it, and then forward the result to another sink for further processing or transmission. Channel sinks are linked into sink chains. The first sink in the sink chain on the client side is often the formatted sink.

    That may take some time to sink in, if you are not too #.

    Applied programming

    MANY developers wrongly believe that Visual Basic .NET is a subset of C# in terms of functionality, states Jeffrey Richter in the book Applied Microsoft .NET Framework Programming in Microsoft Visual Basic .NET. Because Visual Basic .NET offers parameterful properties, exception filtering, more flexible ways to implement interface methods, method static variables, optional parameters and default arguments. A sampler from the book:

  • When installing a new application, you discover that it has somehow corrupted an already installed application. This predicament is known as "DLL hell". This type of instability puts fear into the hearts of the typical computer user. The .NET Framework addresses the DLL hell by fixing the problem of having an application's state scattered all over a user's hard disk. As for security, the .NET Framework includes a new security model called code access security.

  • Different languages handle overflows in different ways. C and C++ don't consider overflows to be an error and allow the value to wrap; the application continues running with its fingers crossed. But Visual Basic considers integer overflows as errors and throws an exception when it detects an overflow. It allows the programmer to decide how overflows should be handled.

  • Constructors are methods that allow an instance of a type to be initialised to a good state. For code to be verifiable, the common language runtime (CLR) requires that every class (reference type) have at least one constructor defined within it.

  • The parameterless ToString method has two problems. First, the caller has no control over the formatting of the string. For example, an application might want to format a number into a currency string or a decimal string, or a per cent string or a hexadecimal string. Second, the caller can't choose to format a string using a specific culture.

  • The next version of Microsoft SQL Server (codenamed "Yukon") is an unmanaged application because most of its code is still written in unmanaged C++. Yukon allows stored procedures to be written in any managed programming language (C#, Visual Basic, Smalltalk, and so on). In the future, productivity applications such as word processors and spreadsheets will also allow users to write macros in any programming language they choose.

    Get ready for the future... by learning some language.

    Server controls

    IF YOU are looking for `a comprehensive guide to authoring ASP.NET server controls', Nikhil Kothari's book Developing Microsoft ASP.NET Server Controls and Components may help. It contains `architectural guidelines, detailed task-based information, and a large number of code samples that range from simple illustrative examples to advanced case studies'. A few picks:

    A well-designed component should perform argument validation in its property setters. When a setter throws an exception, it flags an erroneous property assignment as soon as it is made. This helps identify the location in user code where the error occurred. If your setter accepts erroneous values, there could be undesirable side effects during program execution when the erroneous value of the property adversely affects the behaviour of your component.

    Custom controls and user controls offer different capabilities for content and layout because of their differing authoring mechanisms. A control's content includes any static text as well as any child controls it contains or renders within itself.

    When a browser makes request to an ASP.NET page, communication is over the stateless HTTP protocol. However, the page framework creates an illusion of stateful execution that enables a page to provide a user experience similar to that of a continuously executing desktop process. To create the illusion of continuity, on each subsequent request after the initial request, the page effectively begins execution where it left off at the end of the previous request.

    A templated control enables page developers to specify some or all of the UI it renders via templates. Templates are fragments of page syntax that can include server controls along with static HTML and other literal text. Templated controls offer significant customisation capabilities and are often referred to as lookless controls because they do not render a predetermined user interface.

    Resources can be classified into two broad categories: culture-neutral and culture-specific. Culture-neutral resources (typically US English) are embedded into the main assembly and are used when a culture-specific resource is not found as part of a fallback mechanism. Culture-specific resources are embedded into satellite assemblies. Each satellite assembly is associated with one particular culture.

    For the uninitiated, this must be sounding as distant as from outer space.

    (Books courtesy: Tata McGraw-Hill www. tatamcgrawhill.com)

    Tailpiece

    "Today is Akshaya Tritiya and I am going to T. Nagar!"

    "Why?"

    "If I buy gold today, it would have a multiplier effect."

    "What would happen if I stayed at home and prepared for CA exams?"

    hindubusinessline@hotmail.com

    D. Murali

    Article E-Mail :: Comment :: Syndication

  • Stories in this Section
    Fund-flow in Prosperous


    Marriage counselling for taxpayers
    If you lend, track where your money goes
    Quick analysis, post-exams
    The sharp edge of Java


    The Hindu Group: Home | About Us | Copyright | Archives | Contacts | Subscription
    Group Sites: The Hindu | Business Line | The Sportstar | Frontline | The Hindu eBooks | Home |

    Copyright © 2003, The Hindu Business Line. Republication or redissemination of the contents of this screen are expressly prohibited without the written consent of The Hindu Business Line