Sunday, April 15, 2012

Difference Between White Box And Black Box Framework

What is reuse of framework?

Reuse - It is advantage of object oriented development. Object oriented approach has a unique feature of inheritance. In this child class acquires properties of parent class. It reduces the development time of a project. No need to rewrite same code again.

Framework - It is a set of classes that work together to achieve a purpose but that must be specialized internally by the designer.


Difference between white box framework and black box framework

1. In white box framework, where developer often needs to know the detailed implementation of framework but in black box framework consists of components that hide their internal implementation.

2. In white box framework less range of flexibility but in black box grater range of flexibility. Developers can choose different components and classes in black box framework. In white box have to show complete details but in black box has flexibility. Developers can select which data to show and which data to hide.


3. In developing, white box framework easy to develop compare to black box because no need to analyses about what data to be hide and what data to be show. In white box complete data is available and all internal information also available. No level of abstraction in white box so easy to develop.

4. White box framework always comes with source code but black box not comes with source code.


5. White box framework requires deep understanding of framework implementation but black box not require deep knowledge of framework development.

Gray Box Framework: A Hybrid Framework of White Box and Black Box
Gray-box frameworks take both inheritance and composition approach, is usually made up with combination of abstract classes and concrete classes. When developing an application framework, there is no requirement that the framework contain either all abstract classes or all concrete classes. In business application sometimes need to inherit all properties of component and sometimes only need to use properties.


In fact, neither pure white-box nor black-box frameworks are practical in the real world. In real world by mixing of white-box frameworks and black-box frameworks effectively create a gray-box frameworks.

Saturday, February 25, 2012

What is Multitasking and Multithreading?

Hello guys, here discuss meaning of multitasking and multithreading with differences.


Multitasking

Multitasking



Difference Between Multitasking and Multithreading
MultitaskingMultithreading
1.Multiple task(process) processed in computer. Single task(process) has multiple sub tasks(threads).
2.A program in running state called process(task).During exicution, process(task) divides into subprocess(subtask) called thread
3.Each task is a heavy-weight process.Each thread is light-weight process.
4.Each task has own memory location.All threads share common memory space.
5.Multitasking used for utilization of CPU.Multithreading for maximum CPU utilization. When task exicutes then sub tasks like input/output operations, read from file etc. During input output operations CPU becomes idle SO multithreading helps to reduce idle time of CPU and CPU utilization optimally.
6.Multiple task like running antivirus, printing document, listening music, copying data etc.Multiple thread in single task like taking input stream, processing data, drawing graphics on screen etc.


multithreading

Multithreading

Thursday, February 23, 2012

What is Dofollow and Nofollow Links?

What is Dofollow link?

Dofollow is a default value of anchor tag(<a>) rel attribute. It is a link building technique. It is used for back linking purpose. Back linking means how many incoming links to your website. It helps to increase your Google page rank. It is also for optimizing search engine.

Example to make a dofollow link:-
In anchor tag no need to specify dofollow value of rel attribute. Default anchor tag is dofollow type.
<a href=”http://www.sampleexamples.com”>Sample Examples</a>



Importance of rel attribute of Anchor tag:-
rel attribute is used to specify relationship between linked document to current document.

<a rel="value">


What is Nofollow link?

It is a HTML anchor tag <a> rel attribute value. It tells to search engine that particular link should not follow by search engine index. When a link with nofollow then it's not impact on search engine index. Basically make nofollow link for paid links.
To make a nofollow link, essential to write nofollow value of rel attribute of HTML anchor tag.

Example to make a nofollow link
<a href="http://www.sampleexamples.com" rel="nofollow">Sample Examples</a>


Hope, you get difference between dofollow and nofollow links.




Saturday, February 18, 2012

Exception Handling Program in Java - How to Handle Exception in Java

This is sample example for how to handle exception in Java Programming. Here we handle error occurs due to array index out of bound.
Here handle error of array size exceed. In this example "exception_demo.java", array size is 10. Means we can insert element into array from arr[0] to arr[9] position. But trying to insert element at arr[10]. So ArrayIndexOutOfBoundsException occurs.

Program Code
//This program illustrates the Exception in a program.
public class exception_demo
{
 public static void main(String args[])
 {
  int []arr=new int[10];
  try
  {
   arr[10]=40; // Error occurs because arr range from 0 to 9
  }
  catch(ArrayIndexOutOfBoundsException e)
  {  
   System.out.println("Error Caught:  Array index out of bounds");
   arr[9]=40;
  }
  System.out.println("Beyond the exception point");
  System.out.println("Last element of array = "+arr[9]);
 }
}

Output

What is ArrayIndexOutOfBoundsException?

It is one of unchecked exception. Such exceptions are not listed in the list. This is identified at runtime. This occurs when array index is beyond the bounds means array size lime exceed.

Hope, this java code helps to understand exception handling in Java.