Search Results

Search found 3 results on 1 pages for 'sahilmahajanmj'.

Page 1/1 | 1 

  • What is the use of Association, Aggregation and Composition (Encapsulation) in Classes

    - by SahilMahajanMj
    I have gone through lots of theories about what is encapsulation and the three techniques of implementing it, which are Association, Aggregation and Composition. What i found is, Encapsulation Encapsulation is the technique of making the fields in a class private and providing access to the fields via public methods. If a field is declared private, it cannot be accessed by anyone outside the class, thereby hiding the fields within the class. For this reason, encapsulation is also referred to as data hiding. Encapsulation can be described as a protective barrier that prevents the code and data being randomly accessed by other code defined outside the class. Access to the data and code is tightly controlled by an interface. The main benefit of encapsulation is the ability to modify our implemented code without breaking the code of others who use our code. With this feature Encapsulation gives maintainability, flexibility and extensibility to our code. Association Association is a relationship where all object have their own lifecycle and there is no owner. Let’s take an example of Teacher and Student. Multiple students can associate with single teacher and single student can associate with multiple teachers but there is no ownership between the objects and both have their own lifecycle. Both can create and delete independently. Aggregation Aggregation is a specialize form of Association where all object have their own lifecycle but there is ownership and child object can not belongs to another parent object. Let’s take an example of Department and teacher. A single teacher can not belongs to multiple departments, but if we delete the department teacher object will not destroy. We can think about “has-a” relationship. Composition Composition is again specialize form of Aggregation and we can call this as a “death” relationship. It is a strong type of Aggregation. Child object dose not have their lifecycle and if parent object deletes all child object will also be deleted. Let’s take again an example of relationship between House and rooms. House can contain multiple rooms there is no independent life of room and any room can not belongs to two different house if we delete the house room will automatically delete. The question is: Now these all are real world examples. I am looking for some description about how to use these techniques in actual class code. I mean what is the point for using three different techniques for encapsulation, How these techniques could be implemented and How to choose which technique is applicable at time.

    Read the article

  • Which platform to choose from .Net or Java [closed]

    - by SahilMahajanMj
    I know that there is a lot healthy discussion about this topic. but my case is entirely different from these discussions. I have just passed out my graduation. During the graduation period, i had done C#.net and java as well. Now i am working as Android programmer in a company. In the recent times, i have heard a lot about pros and cons of these platforms. What our seniors used to suggest that, ASP.net is a lot better than JSP for website developement. .net provides us lot of in built tools and API's for building powerfull applications. Java's platform independancy has always been issue among them. Security fetures are more in java. .Net has more powerfull IDE's. Now i am a bit confused on which platform to choose from these. I found java better from two, so did i prefer to choose android. Also, the discussion always ends with an issue that java has no scope for job as far has .net does. I would like to hear suggestions on this topic, but it would be better, if you consider indian IT market for this discussion.

    Read the article

  • Window 7 hangs on using Adobe Reader

    - by SahilMahajanMj
    Window 7 often hangs when i open some pdf file with Adobe Reader. First of all, Adobe Reader crashes and as soon as it stops, the window hangs and after few seconds, it displays a message quoting "Dumping Physical Memory" in a typical Windows98 manner and then the system reboots. This problem persists each time i use Adobe Reader. However, i have installed Foxit Reader to view Pdf files. But there are some issues with that also. As sometimes i have editable files, which could be done in Adobe Reader's newest version only. Suggestions on how to solve this problem would be appreciated.

    Read the article

1