Page 256 - DCAP404 _Object Oriented Programming
P. 256

Unit 11: Pointers and Dynamic Memory Management




                                                                                                Notes
             instantiate the object. From the client’s perspective, the object already exists and calls can
             be made to it without the need to create or initialise the object. This is the default behaviour
             of SOAP-based Web services.
             Digest authentication does not transfer the user’s password in the clear; instead a hash, or
             digest, of the password and data provided by the server is used to authenticate the user.

             From a developer’s perspective, .NET My Services eliminates many of the problems of
             securing data, providing encrypted transport channels, and reconciling disparate data
             sources. And all of this is achievable using XML Web services, so businesses are spared the
             drastic learning curve associated with new technologies.
             Remember, they say Web services are the next big thing.
             From OOP to more

             LET us say you already understand OOP (object-oriented programming) concepts such as
             data abstraction, inheritance and polymorphism. And that  you want to ‘leverage  the
             power of .NET Framework to build, package and deploy any kind of application’. Jeffrey
             Richter’s “Applied Microsoft .NET Framework Programming” has the answers. Read on:

             As an application runs, the common language runtime (CLR) maintains a ‘snapshot’ of the
             set  of  assemblies  loaded  by  the  application.  When  the  application terminates,  this
             information is compared with the information in the application’s corresponding .ini file.
             If  the application  loaded the  same set  of assemblies  that  it  loaded  previously,  the
             information  in the .ini file  matches the information in memory  and the  in  memory
             information is discarded.
             Sometimes the add and remove methods the compiler generates are not ideal. For example,
             if you’re adding and removing delegates frequently and you know that your application
             is single-threaded, the overhead of synchronising access to the object that owns the delegate
             can really hurt your application’s performance.
             Compilers convert code that references an enumerated type’s symbol to a numeric value
             at compile time. Once this occurs, no reference to the enumerated type exists in metadata
             and the assembly that defines the enumerated type doesn’t have to be available at run
             time. If you have cod that references the enumerated type - rather than just having references
             to symbols defined by the type - the assembly that defines the enumerated type will be
             required at run time.
             A try block doesn’t have to have a finally block associated with it at all; sometimes the
             code in a try block just doesn’t require any cleanup code. However, if you do have a finally
             block, it must appear after any and all catch blocks, and a try block can have no more than
             one finally block associated with it.
             If the CLR suspends a thread and detects that the thread is executing unmanaged code, the
             thread’s return address is hijacked and the thread is  allowed to resume execution.  A
             pinned object is one that the garbage collector isn’t allowed to move in memory.
          11.6 Summary


              A pointer is a variable that holds the memory address of the location of another variable
               in memory. A pointer is declared in the following form:

               type    * var_name ;
               where type is a predefined C++ data type and var_name is the name of the pointer variable.




                                           LOVELY PROFESSIONAL UNIVERSITY                                   249
   251   252   253   254   255   256   257   258   259   260   261