Vajad kellegagi rääkida?
Küsi julgelt abi LasteAbi
Logi sisse

Object-oriented programming. (0)

1 Hindamata
Punktid
Object -oriented programming.
Object-oriented programming (OOP) is a programming paradigm that uses "objects" and their interactions to design applications and computer programs. Programming techniques may include features such as information hiding, data abstraction, encapsulation, modularity, polymorphism, and inheritance. It was not commonly used in mainstream software application development until the early 1990s. Many modern programming languages now support OOP.
Class
Defines the abstract characteristics of a thing (object), including the thing's characteristics (its attributes, fields or properties) and the thing's behaviors (the things it can do, or methods, operations or features). One might say that a class is a blueprint or factory that describes the nature of something. For example, the class Dog would consist of traits shared by all dogs , such as breed and fur color (characteristics), and the ability to bark and sit (behaviors). Classes provide modularity and structure in an object-oriented computer program . A class should typically be recognizable to a non-programmer familiar with the problem domain, meaning that the characteristics of the class should make sense in context . Also, the code for a class should be relatively self-contained (generally using encapsulation). Collectively, the properties and methods defined by a class are called members .
Object
A pattern (exemplar) of a class. The class of Dog defines all possible dogs by listing the characteristics and behaviors they can have; the object Lassie is one particular dog, with particular versions of the characteristics. A Dog has fur; Lassie has brown -and-white fur.
Method
An object's abilities. In language , methods (sometimes referred to as "functions") are verbs . Lassie, being a Dog, has the ability to bark. So bark() is one of Lassie's methods. She may have other methods as well, for example sit() or eat() or walk () or save_timmy(). Within the program, using a method usually affects only one particular object; all Dogs can bark, but you need only one particular dog to do the barking.
Inheritance
"Subclasses" are more specialized versions of a class, which inherit attributes and behaviors from their parent classes, and can introduce their own. For example, the class Dog might have sub-classes called Collie, Chihuahua , and GoldenRetriever. In this case , Lassie would be an instance of the Collie subclass. Suppose the Dog class defines a method called bark() and a property called furColor. Each of its sub-classes (Collie, Chihuahua, and GoldenRetriever) will inherit these members, meaning that the programmer only needs to write the code for them once . Each subclass can alter its inherited traits. For example, the Collie class might specify that the default furColor for a collie is brown-and-white. The Chihuahua subclass might specify that the bark() method produces a high pitch by default. Subclasses can also add new members. The Chihuahua subclass could add a method called tremble(). So an individual chihuahua instance would use a high-pitched bark() from the Chihuahua subclass, which in turn inherited the usual bark() from Dog. The chihuahua object would also have the tremble() method, but Lassie would not, because she is a Collie, not a Chihuahua. In fact , inheritance is an "a... is a" relationship between classes, while instantiation is an "is a" relationship between an object and a class: a Collie is a Dog ("a... is a"), but Lassie is a Collie ("is a"). Thus, the object named Lassie has the methods from both classes Collie and Dog. Multiple inheritance is inheritance from more than one ancestor class, neither of these ancestors being an ancestor of the other . For example, independent classes could define Dogs and Cats , and a Chimera object could be created from these two which inherits all the (multiple) behavior of cats and dogs. This is not always supported, as it can be hard both to implement and to use well.

Example


DEFINITION MODULE Counter ;

PROCEDURE InitialiseCounter(InitialValue: INTEGER );

PROCEDURE IncrementCounter;

PROCEDURE GetCounterValue(): INTEGER;

END Counter.

IMPLEMENTATION MODULE Counter;

VAR MyCounter: INTEGER;

PROCEDURE InitialiseCounter(InitialValue: INTEGER);

BEGIN

MyCounter := InitialValue;

END InitialiseCounter;

PROCEDURE IncrementCounter;

BEGIN

INC(MyCounter);

END IncrementCounter;

PROCEDURE GetCounterValue(): INTEGER;

BEGIN

RETURN MyCounter;

END GetCounterValue;

BEGIN

MyCounter := 0;

END Counter.


Summary


OOP can be used to translate from real -world phenomena to program elements (and vice versa). OOP was even invented for the purpose of physical modeling in the Simula -67 programming language. However, not everyone agrees that direct real-world mapping is facilitated by OOP, or is even a worthy goal ; Bertrand Meyer argues in Object-Oriented Software Construction that a program is not a model of the world but a model of some part of the world; "Reality is a cousin twice removed". At the same time, some principal limitations of OOP had been noted.
Object-oriented programming #1 Object-oriented programming #2 Object-oriented programming #3 Object-oriented programming #4
Punktid 50 punkti Autor soovib selle materjali allalaadimise eest saada 50 punkti.
Leheküljed ~ 4 lehte Lehekülgede arv dokumendis
Aeg2009-05-07 Kuupäev, millal dokument üles laeti
Allalaadimisi 19 laadimist Kokku alla laetud
Kommentaarid 0 arvamust Teiste kasutajate poolt lisatud kommentaarid
Autor meribel11 Õppematerjali autor
Inglise keeles
Sisu: Class, Object, Method,Inheritance,Example ,Summary

Sarnased õppematerjalid

Tarkvara kokkuvõte inglise keeles
36
doc

Tarkvara kokkuvõte inglise keeles

1. OBJECT-ORIENTED PARADIGM The Model •The model defines an abstract view to the problem. This implies that the model focuses only on problem related stuff and that you try to define properties of the problem. These properties include: 1 •the data which are affected and 2 •the operations which are identified by the problem. Object-oriented Paradigm •Everything is an object •A program is a bunch of objects telling each other what to do by sending messages •Each object has its own memory made up of other objects •Every object has a type •All objects of a particular type can receive the same messages Domain Model •A domain model does not represent the entire domain as it is in the real world. It includes only the concepts that are needed to support the application. Object •Is a partitioned area of memory where object code is stored •The area of memory is protected •This code can function relatively independently of other objects

Tehnoloogia
IT arhitektuur
44
doc

IT arhitektuur

store data. MVC does not specifically mention the data access layer because it is understood to be underneath or encapsulated by the model. View Renders the model into a form suitable for interaction, typically a user interface element. Multiple views can exist for a single model for different purposes. Controller Processes and responds to events (typically user actions) and may indirectly invoke changes on the model. In computer programming, the proxy pattern is a software design pattern. A proxy, in its most general form, is a class functioning as an interface to something else. The proxy could interface to anything: a network connection, a large object in memory, a file, or some other resource that is expensive or impossible to duplicate. A well-known example of the proxy pattern is a reference counting pointer object. In situations where multiple copies of a complex object must exist the proxy pattern can be adapted

It arhitektuur
English structure revision for the exam
40
docx

English structure revision for the exam

(I love this place).  A verb expresses an action, process or a state. (I love this place).  An adjective describes a noun. (This place is lovely). 2) Distribution test → Takes the context in which the word occurs in, into consideration. Also the whereabouts of the word in a sentence For example:  Kim is an engine driver. → Engine could mean either happy or a mechanical object.  Kim seems engine 3) A formal test → With nouns we can test if it contains morphemes which makes word a noun. For example:  Noun can have a plural ending s  Noun can have a possessive form. Boys’  Nouns usually go with determiners: an apple, a ball, the red car  We can determine an adjective if it has a degree of comparison. For

Inglise keel
Games Programming with Java and Java 3D
23
pdf

Games Programming with Java and Java 3D

Games Programming with Java and Java 3D Andrew Davison Dept. of Computer Engineering Prince of Songkla University HatYai, Songkhla 90112 E-mail: [email protected] Draft: 14th January 2003, #2 Abstract This article looks at the advantages and disadvantages of using Java and Java 3D for games programming. It assumes the reader is familiar with Java, but presents short overviews of gaming, the low-level APIs OpenGL and DirectX, and Java 3D. No programming examples are included here, although links to online code are supplied. 1. Background to Gaming Giving a definition for `computer game' is problematic, due to the wide range of game types. For example, the ArcadePod site (http://www.arcadePod.com) divides its hundreds of Java games into more than ten categories: 3D games, multiplayer, action,

Java programmeerimine
Inglise keele struktuur
29
docx

Inglise keele struktuur

phrases (examples!); modals and primary auxiliaries (be, do have): their differences (contribution to the VP, finite and non-finite forms) and similarities (the NICE properties); meanings of the modal verbs: epistemic modality, deontic modality, dynamic modality (examples!); types of main verbs: intransitive verbs(has no object), transitive (monotransitive -A monotransitive verb is a verb that takes two arguments: a subject and a single direct object. For example, the verbs buy, bite, break, and eat are monotransitive in English., ditransitive- a ditransitive verb is a verb which takes a subject and two objects which refer to a recipient and a theme. E.g. The man bought his wife a ring , complex transitive verbs-A verb that requires both a direct object and another object (usually an object of a preposition) or a complement.), linking verbs, dynamic vs. stative

Inglise keel
Inglise keele morfoloogia ja süntaks
5
odt

Inglise keele morfoloogia ja süntaks

sell, give, send, ... event with 3 arguments syntactic arguments ­ the constituents that appear in the positions of S, DO and IO syntactic valency ­ how many syntactic arguments the verb can take complements ­ obligatory dependents of the head of some phrase modifiers ­ optional dependent of an item in a phrase semantic roles (thematic roles) ­ the roles performed by the referents of NPs in a clause agent ­ an animate being who deliberately performs an action patient ­ the direct object that undergoes the action of the verb theme ­ an entity undergoing some action goal ­ an entity towards which the action is directed experiencer ­ someone who experiences something possessor ­ the one who possesses something intransitive ­ they take no object complement ­ arrived, went, lie transitive/monotransitive ­ takes one object complement- painted, wrote, eats ditransitive ­ take DO and IO reporting verbs ­describe what people say or think (suggest, say, wonder)

Inglise keel
Veebiteenused-kordamisküsimused ja vastused kontrolltööks
40
doc

Veebiteenused (kordamisküsimused ja vastused kontrolltööks)

– Atribuudid (Attributes) – Nende tüübid  Tavatüübid (Simple types)  Komplekstüübid (Complex types)  Piirangud (Restrictions) XSD võrdlused andmebaasi tabelite ja java klassidega  XSD – Document structure  XML – Document instance  Table structure  Record in a Table  Class definition  Object instance XSD määrab..  Millised elemendid ja atribuudid tohivad olla dokumendis  Millised elemendid on alamelemendid  Alamelementide järjestuse ja arvu  Kas element on tühi või sisaldab teksti  Andmetüübid elementide ja atribuutide jaoks  Vaikimisi ja fikseeritud väärtused elementidele ja atribuutidele  Piirangud The purpose of an XML Schema is to define the legal building blocks of an XML document:

Programmeerimine
Translation history
14
docx

Translation history

Summary • Early history of translation studies – Cicero and St. Jerome (what did they do/how/why are they relevant to translation studies?) St. Jerome – Greek scholar, did some translation work. Lived during the 4th century. Jerome is best known as the translator of the Bible into Latin. A previous version (now called the Old Latin) existed, but Jerome's version far surpassed it in scholarship and in literary quality. Jerome was well versed in classical Latin (as well as Greek and Hebrew), but deliberately translated the Bible into the style of Latin that was actually spoken and written by the majority of persons in his own time. This kind of Latin is known as Vulgate Latin (meaning the Latin of the common people), and accordingly Jerome's translation is called the Vulgate. Cicero – Lived during the 1st century BC. Roman politician, philosopher & translator. Theory ‘‘word-for-word’’ & ‘‘sense-for-sense’’. • Martin Luther ?

Inglise keel




Kommentaarid (0)

Kommentaarid sellele materjalile puuduvad. Ole esimene ja kommenteeri



Sellel veebilehel kasutatakse küpsiseid. Kasutamist jätkates nõustute küpsiste ja veebilehe üldtingimustega Nõustun