Subscribe by Email


Showing posts with label Software Design. Show all posts
Showing posts with label Software Design. Show all posts

Monday, December 10, 2012

What is Object Proxy Mechanism in IBM Rational Functional Tester?


The proxy pattern is recognized as a pattern for software designing in the field of computer science. In the most general term, the proxy can be defined as a class which functions as an interface to some other program or application. 

Where is Proxy used?

- A proxy can be used as an interface to anything such as the following:
  1. A network connection
  2. A large object present in the memory
  3. A file
- Or in other words, we can say that it can be used for any resource that is quite expensive and it is not affordable to duplicate it.
- An example of the proxy can be given by a reference counting pointer object. 
- There are situations where it is required to have multiple copies of a complex object. In such situations proxy pattern comes to play a big role. 
- It is adapted for incorporating the fly weight pattern for reducing the memory foot print of the application. 
- In typical situations, the instance created for a complex object is only one in count and multiple proxy objects are created. 
- All these proxy objects consist of a reference to an original object that is both single and complex. 
- The operations that are performed in a proxy object are carried forward to the original object. 
- If all the instances created for the proxy lose their scope, the memory of the complex object is de–allocated for that particular instance. 
- A virtual proxy pattern is used in java. 
- A proxy class can be used to access the remote methods. 

About Object Proxy Mechanism

- Firstly, an interface is created against which the rational functional tester creates the classes using the proxy patterns. 
- An interface may consist of many methods. 
- These methods need to be coded by all the classes which are to implement those particular methods. 
- If a proxy class is running on some other system rather than the original class, then the proxy class can represent its real image itself over there. 
- All the information regarding the image is obtained from the disk. 
- The multiple loading of the image can be avoided by using the proxy pattern with the code of the image. 
- This happens so because the image is accessed in a memory saving manner from some other system. 
- The primary purpose of the proxy object is to act as an intermediate object between the accessible object and the client. 
- The proxy object then serves the purpose of monitoring the life span of the object that is accessible. 
- Also, if the accessible object is not destroyed, all the calls are forwarded to it. - The proxy object checks for the availability of the accessible objects whenever a client makes calls to its accessible properties for getting some info. - If the object is found to be available, the client’s call is passed on to that accessible object. 
- If the case is opposite i.e., if the object is unavailable, an error is returned by the proxy object. 
- Returning of an error message by the proxy object is an indication that the destruction of the object has taken place and this indication is recommended.
The error returned is “CO E OBJNOTCONNECTED”.
- The COM or the component object model returns this error after CoDisconnectObject is called by the server. 
- A transparency is maintained between the client and the proxy object. 
Whenever client calls an accessible object, a pointer to the interface of that object is returned to the client. 
- In turn when this pointer is used by the client to call any of the object’s properties or methods, the execution of the code takes place within proxy object. 
- It is important for the rational functional tester to understand the interface of a given object in order to interact with it. 
- Usually, it is easy to interact with objects such as buttons, list boxes etc, however there are some custom objects in an application for which a proxy needs to be created.


Thursday, April 14, 2011

What are different characteristics of design patterns?

A design pattern is a general repeatable solution to a commonly occurring problem in software design.
- It is a proven solution to problems that keep recurring.
- They are reusable solutions to common problems.
- Design patterns are not frameworks.
- Design patterns are more abstract than frameworks.
- Design pattern cannot be directly implemented.
- Design patterns are more primitive than a framework.
- A design pattern cannot incorporate a framework.
- Patterns may be documented using one of several alternative templates.
- Design patterns can speed up the development process by providing tested, proven development paradigms.
- Reusing design patterns helps to prevent subtle issues that can cause major problems and improves code readability for coders and architects familiar with the patterns.
- Patterns allow developers to communicate using well-known, well understood names for software interactions.

A pattern description includes the following elements:
- name of the pattern should be meaningful.
- context of the pattern represents the circumstances or preconditions.
- Problem description that pattern addresses should be provided.
- Solution is a description of the static and dynamic relationships amongthe components of the pattern.
The use of design patterns requires careful analysis of the problem that is to be
addressed and the context in which it occurs.


Facebook activity