Deep In Open Source

Sharing Knlowledge With The World…

Package in JAVA

JAVA

Suppose you and your friend are freelancers and work as a team. You got a project which has to complete in one week. So you decided to divide the project in two modules and each of you works on different module. In this way you can complete the project in time. Say the name of the module on which you working is ‘module-A’ and the module on which on your friend is working is ‘module-B’.

Now both of the modules have the class name ‘Utility’.

When you combine both the module at the last then you have two ‘Utility’ classes. Now how you would identify which ‘Utility’ class belong to whom. Package is the solution for these types of problems.

Both of you write your code in your package and the both the ‘Utility’ classes belong to different packages, so there is no ambiguity.

One Liner: A Package in JAVA is a namespace that organizes a set of related classes and interfaces.

You can relate packages as being similar to the folders on your computer. You can put images in one folder, application in another and movies in another. Software written in Java programming language can be composed of thousands of classes so it is good practice to organize our packages and classes in by putting then in different packages.

When creating a package, you should choose a name for the package and put a package statement with that name at the top of every source file that contains the classes, interfaces, enumerations, and annotation types that you want to include in the package.

The package statement should be the first line in the source file. There can be only one package statement in each source file, and it applies to all types in the file.

If a package statement is not used then the class, interfaces, enumerations, and annotation types will be put into an unnamed package.

 

Example of Package in JAVA:

 

package car;

 interface Car {

   public void run();   public void break();

}

 

package car; 

public class Honda implements Car {  

public void run(){}  

public void break(){}

}

 

Continue Reading

What is an Object in Object Oriented Programming ?

Object

An object can be a variable, function, or data structure. In the object oriented programming paradigm, “object” refers to a particular instance of a class where the object can be a combination of variables, functions, and data structures

Objects refer the state and behavior of the class.

If you see around yourself you would find real world example for object like pen, bike, mobile, etc. If you notice then all these real world object examples share two common things, i.e. state and behavior. Pen have state (color, length) and behavior (write) also, similarly bike have state (brand, color) and behavior (make call, receive call).

Similarly object in Object-oriented programming also have state and behavior

One Liner: Objects are software bundles of data and related methods.

Anything that the Object in object oriented programming knows (state) and can do (behavior) is expressed by the variables and methods within that object.

Let’s try to understand the OOPs object with the example of real world example:

OOPs Object

As shows in the figure OOP object has variable and methods.

Object in object oriented programming have state (variable) and behavior (methods).

If we try to create similar real world object of dogs then it state would be: Color, Breed, Name and behavior can be: Barking, Walking, etc.

Realworld Object

Continue Reading

Garbage Collection in JAVA

Garbage Collection in JAVA

 One of the finest achievement of the JAVA is Garbage Collection. Now developers not to worry about allocation and de-allocation of the memory and create new objects. The responsibility of reclaiming the memory is of Garbage Collector.

One Liner: Garbage Collection is the mechanism provided by Java Virtual Machine to reclaim heap space from objects which are eligible for Garbage Collection.

In order to understand how Garbage Collection works in java, first we need to understand how memory is managed in Java Virtual Machine (JVM).

Heap Memory

When a JAVA programme starts, OS allocate some memory to JVM. JVM uses this memory for its need and use a part of this memory as Heap Memory.

Heap Memory is the area of the memory used for dynamic allocation. Generally Heap is located at the bottom of address space and move upwards.

 

Memory Allocation in JVM

Memory Allocation in JVM

When we create any object, the memory is allocated to object from heap and when the object is collected by Garbage Collector the memory goes back to Heap Memory.

 

Objects Eligible for Garbage Collection in Java

Garbage Collector collects the objects which are not in the use.

One Liner: An object is in use if it can be reached or accessed by the running program.

In JVM, running Java programme have many running threads, each of which is executing the method(s).

Each of the method have reference to objects as arguments or local variable. These reference belong to Root Set of References. Root set of references are the references which are immediately accessible by the programme. Static references variables and references registered through Java Native Interface (JNI) API are also belongs to Root Set of References.

Following are some scenarios in which the object is eligible for garbage collection:

  • The object is not referred by any references or we can say that all the references of the object is set to null.
  • Reference goes out of scope once control exit the block or method.
  • When you set the reference of the object to null, all the object which are referred by only this object is eligible for garbage collection.
  • If there is cyclic reference, then all the object in the cycle are eligible for garbage collection.

E.g.: a=b; b=c; c=a

  • When the object only have weak reference or soft reference.

 

How Garbage Collection in JAVA works

 

To identify which objects are eligible for garbage collection in Java, JVM runs mar-and-sweep-algorithm.

It’s a two-step straightforward process:

  • All object’s references traverse in this algorithm, starting from root set and marked as live object.
  • Then Garbage collector collect those objects which are not marked as live objects and reclaim the heap memory.

 

Garbage Collection in JAVA

Garbage Collection in JAVA

Continue Reading

Cloud Computing Pros and Cons

Cloud Computing Pros and Cons

 

Cloud Computing Pros and ConsCloud Computing has definitely emerged as one of the most upcoming technologies , where organizations are considering to upgrade their infrastructure to support cloud computing.We have put together a list of Cloud Computing Pros and Cons that a company should be aware of in regards to cloud computing.

Cloud Computing Pros

Cost Effective

Cloud Computing is highly cost efficient in terms of maintenance . Traditional desktop software contribute to extra cost when adding multiper user licences which increases the cost to company. While cloud technology is comparatively lot cheaper than maintaining your own hardware.There are many one-time-payment, pay-as-you-go and other scalable options available.

Unlimited  Storage (Almost !!)

You need not worry about running out of storage space , the cloud service provider will take care of all storage concerns.You just need to request for additional space.

Backup Recovery

Backup and high availability is perhaps one of the greatest advantages of computing on cloud. Since all data is available in cloud ,it is much easier to maintain backups rather than having data on a physical device.

Data accessibility

Since data is always available , it can be accessed from any part of the world (as long as you have a internet connection!!) .Time zone difference are taken care of as well.

Environmental Benefits

Cloud computing drastically reduces the carbon emissions for an organization . Studies show that total carbon emission reduces by upto 35%.

Cloud Computing Cons:

Security

This perhaps is the biggest threat when it comes to Cloud computing.All the enterprise data is at the helm of a third party vendor which could pose major threat if the vendor is not reliable.

Compatibility

While moving onto cloud , organizations would have the need to replace their existing IT infrastructure so that it is compatible on cloud.This could prove to be a costly affair.

Standardization

It could happen that the cloud service vendor does not have proper standard for cloud computing. IEEE has set standards in cloud computing for optimum quality .In order avoid pitfalls due to standardization , the company needs to investigate if the provider uses standard technology.

Conclusions

Yes cloud computing does have certain disadvantages associated with it , but the Pros outweighs the cons . These risks can be easily mitigated if the company involved takes steps to manage these risks. However the immense benefits that cloud computing  offers is over whelming and extremely beneficial . Cloud computing and BI is definitely the way of the future.

 

Continue Reading

Business Intelligence Benefits – Top 10 Reasons your business should go for BI

Business Intelligence Benefits

Business Intelligence BenefitsBusiness Intelligence is on the verge of huge change. For a long time it has been limited to only the larger organizations . With the advent of open-source technologies , BI has become much more accessible . In today’s post we would be discussing some key  Business Intelligence benefits to create awareness of this wonderful concept and as to why one should leverage BI capabilities in their enterprise solutions.

1) Stay ahead of competition

Arm your team with compelling BI reporting and examination so they can stay in front of the pack, and exploit patterns and new open doors as they arrive. Visually intelligent dashboards gives your group access to sales financial and operational parameters of your product/organization as well as your competitor.

2) Foresee and react to patterns

Examine organization and competitor information to set competitive objectives, and track achievements against key performance indicators for the business . Analyze trends and mitigate business risks. Apply hypothetical variables to your information to foresee possible outcomes , historical informational data caters to creation of a predictive model.

3) Empower Decision Making with on-demand data .

Business Intelligence  lets your team, from field reps to top level administration, access dynamic data and empower them with business perspective by offering deep insights into data , enabling better decision making.

4) Visual dashboards and custom-made reports at your fingertips.

Visually stunning and detailed information could be conveyed to the significant individuals via reporting dashdboards with custom reports , with ability to drill down and dissect the information to gain insights. Furthermore BI reports has provisions to customize reports to fit each users needs through simple drag drop functionality.

5) Reduce wastage , efficient manage resources.

BI helps to get rid of  nonaligned data systems and eliminate resource wastage. Eliminates wasting time and resources spent on correcting data errors and manually compiling spreadsheet based reports , so your resources can add maximum value to the organization growth by focusing more on the business growth.

6) Track and monitor Customer behavior

Business Intelligence helps you to identify what customers are buying, what are trends of the buying customers. You can monitor customer behavior and use data insights to drive loyalty and maximize profit by identifying up-sell and cross-sell opportunities. BI also provides opportunities to identify conversions for a potential lead to become a customer

DataWareho

7) Ability to mine data , discover your true manufacturing costs

Business Intelligence software has the ability to create automated alerts to notify managers of incidents that require action. This brings more efficiency in managing procurement , managing inventory , delivery which reduces cost and mitigates risks.

8) Discovering New Questions and Their Answers

Business intelligence is data driven in nature , trending patterns helps us identify and ask new questions leading to a data-driven discovery. Else it could work the other way round where-in you may have certain questions which could be answered using historical data in the warehouse.

9)  Mobile Device Accesibility

BI enables easy integration with various  mobile devices like I-pads,laptops , mobiles. Hence reps/directors can have access to reports on-site on -fields or in office.

10) Efficient Data Management

BI enables integration of enterprise wide  disparate data sources into a single unified data-warehouse,  to ensure consistency and accuracy. This data is cleansed quality data , which makes data management very easy.

These points here just scratch the surface when it comes to Business Intelligence benefits , if you feel strongly feel about other benefits you want to point out please feel free to comment below and let us know.

Check this very awesome video out which outlines BI concepts in a very interesting way.

Continue Reading

Informatica Tutorials For Beginners

informatica tutorial for beginners

In our quest to find something useful for our users across the web , today we would like to showcase to you some really awesome content compiled by http://www.disoln.org . These set of videos provide all possible Informatica tutorials for beginners that is needed . The video series has been divided into many sections (and subsections) ,

Section1 –

Deals with basic introduction to Informatica and its essential components . This section then continues to give introductions to basic components  and finally the last video winds up with a complete functional informatica workflow.

Informatica Tutorial 1.1 – Client Components Introduction -Introduction to Informatica PowerCenter Client components, Includes Designer, Workflow Manager, Workflow Monitor and Repository Manager.

 

Informatica Tutorial 1.2 – Client Configuration (Add Repository)-This Video shows the configuration required for the Powercenter Client before it can get connected to Repository Server.

Informatica Tutorial 1.3 – Working with Source Analyzer -This Video shows the Step-by-Step process for creating different type of source definition using source analyzer in Powercenter.
Informatica Tutorial 1.4 – Working with Target Designer -This Tutorial Video shows the Step-by-Step process for creating Target definition using Target analyzer in Informatica Powercenter.
Informatica Tutorial 1.5 – Create My First Mapping -This Tutorial Video shows the Step-by-Step process for creating your first Informatica mapping.

Informatica Tutorial 1.6 – Create My First Workflow -This Tutorial Video shows the Step-by-Step process for creating your first Informatica Workflow.

Informatica Tutorial 1.7 – Schedule and Monitor Workflow-This Tutorial Video shows the process for creating your Informatica Workflow, Schedule and Monitor the Workflow.

Informatica Tutorial 1.8 – Aggregator Transformation & Multiple Data Sources -This Tutorial Video shows the process for creating mapping with multiple data sources, create Expression and Aggregator Transformation.

Informatica Tutorial 1.9 – Work with Flat File, LookUp & Filter Transformation -This Tutorial Video shows the process for creating mapping with Fixed Width File data source, create LookUp and Filter Transformation

These set of  Informatica tutorials videos would suffice for any beginner who is trying to learn this awesome tool!! For practical informatica related scenarios you could check out this page .

Continue Reading

Source Target Level Commit in Informatica

Source Target Level Commit in Informatica

In this post we will discuss how Source Target Level Commit in informatica works.

First of all What is a Commit to a Data Base : – A Commit is a instruction to the database server , which tells it to the save the state of the database session at that point of time.

Informatica supports two commit categories / levels :-

1) Source Level Commit

2) Target Level Commit

Source Level Commit :-  In this type of commit  an integration service issue commit  to the underlying data base (Oracle , SQL Server e.t.c.) when a particular number of rows has been read from the source data base irrespective of the number of rows inserted to the data base.

Let’s Take an Example : –

A (ORACLE) source is reading and it has taken 505 rows till now and in target there you have 300 inserted rows so far , and mean while rest of the rows are getting processed with in the mapping and in session properties you have selected source level commit with row interval of 510. As soon as source will pick 510th row the integration service will issue a commit to the underlying data base however there are still 300 rows in target  , only 300 rows will be committed. Rest rows will be committed either again reading 510 rows or after completion of the session.

Number of source rows reading matters in this case.

Target Level Commit :- In this commit type the integration service issues a commit to the data base once a particular number of rows are inserted to the data base.

Let’s Take an Example : –

your source is reading and has read 500 rows so far and in the session properties you had selected Target Level Commit with commit interval of 300 rows. And in target you have 250 rows so far , now your source has read 800 rows and in your target you just touched 300th row , immediately a commit will fire on the target data base.

Number of target rows affected matters in this case.

Author : – Ankit Kansal & Nayan Naik

 

 

Continue Reading
PageLines