specvilla.blogg.se

Inform it
Inform it




inform it
  1. Inform it how to#
  2. Inform it code#

The copy protection on CDs is different from DVD copy protection, and the storage capacity is different as well. A CD drive is also a type of optical media device, but it has different characteristics. It has a specific storage capacity along with the ability to hold a digital movie.

Inform it code#

Although it is possible to take the code from a method and embed it directly inline with the caller’s code, refactoring of code into a method provides encapsulation benefits.Ĭonsider the following example: A DVD drive is a type of optical media device. The details can still be accessed when necessary, but by intelligently encapsulating the details, large programs are made easier to understand, data is protected from inadvertent modification, and code becomes easier to maintain because the effects of a code change are limited to the scope of the encapsulation. The OpticalStorageMedia class is the programming abstraction of the real-world object of a CD or DVD player.Ĭlasses exhibit the three principal characteristics of object-oriented programming: encapsulation, inheritance, and polymorphism.Įncapsulation allows you to hide details. The class OpticalStorageMedia, for example, may have an Eject() method on it that causes a disk to eject from the player. A group of classes form a programming abstraction, model, or template of what is often a real-world concept. The most fundamental construct in object-oriented programming is the class. Object-oriented programming provides one of the key methodologies in accomplishing this goal, to the point that it is difficult for object-oriented programmers to envision transitioning back to structured programming, except for the most trivial programs. The key to programming successfully today lies in the ability to provide organization and structure to the implementation of the complex requirements of large applications.

inform it

The next chapter builds on this foundation with the introduction of inheritance and the polymorphism that object-oriented programming enables.īeginner Topic: Object-Oriented Programming This chapter delves into how C# supports encapsulation through its support of constructs such as classes, properties, and access modifiers we covered methods in the preceding chapter. The general text outside the Beginner Topics focuses on using C# for object-oriented programming with the assumption that readers are already familiar with object-oriented concepts. Readers unfamiliar with object-oriented programming should read the Beginner Topic blocks for an introduction. One of the key advantages of object-oriented programming is that instead of creating new programs entirely from scratch, you can assemble a collection of existing objects from prior work, extending the classes with new features, adding more classes, and thereby providing new functionality. Even more importantly, it was easier to create much larger programs because the code within those programs was better organized.

inform it

The result was that smaller programs were simplified somewhat. The transition from structured, control-flow-based programs to object-oriented programs revolutionized programming because it provided an extra level of organization. However, by wrapping those constructs within classes, you can create larger, more organized programs that are more maintainable.

Inform it how to#

A key focus is on how to define classes, which are the templates for objects themselves.Īll of the constructs of structured programming from the previous chapters still apply within object-oriented programming. This chapter introduces the basics of object-oriented programming using C#.






Inform it