• Best of luck to the class of 2024 for their HSC exams. You got this!
    Let us know your thoughts on the HSC exams here
  • YOU can help the next generation of students in the community!
    Share your trial papers and notes on our Notes & Resources page
MedVision ad

OOP questions.. (1 Viewer)

Glide

Member
Joined
Oct 13, 2003
Messages
103
Hey guys..

Strugging a little with OOP concepts. My text book (Fowler) really has bad descriptions of basic OOP concepts..

Anyone got good definitions of Encapsulation, polymorphism and Abstraction?

I kinda know what encapsuation is.. its where programming language dont expose the code behind methods or properties, but rather leave it as a 'backbox'.. which allows the developer to focus on the task at hand, making programming large projects less complex.

From what I gather, abstraction is where you ignore the big picture, and break code down into simple tasks, concentrating on each one seperately.. (poor definition)

And polymorphism is where you create subclasses from a parent class to allow the creation of the multiple objects of the same structure more easily..

Thats what I gather, I really am struggleing to find good understandable definitions, any assistance would be appreciated. :) thanks.
 

Glide

Member
Joined
Oct 13, 2003
Messages
103
Theres a lot of information there... :\
Still confusing.. it seems theres no easy way to describe either of them :(
 

Freedom_Dragon

The 36th Dragon
Joined
Oct 11, 2003
Messages
154
Location
Behind a door that will never open.
Gender
Undisclosed
HSC
N/A
In the exam, u dont really need highly defined definition
unless u are aiming to get band 6.

Im just hoping to get through this with ok mark since im running
out of time.

I understand how u fell about these definition which at times
are not so clear/not well defined.

Encapsulation: I think the definition u stated is good, stick to that
one, i also just want to add that Encapsulation helps to build a secure system( Hidden instructions).

Abstraction : Can be easier understood in terms of "picking out"
the hidden common features(codes behind mothod) of the objects that was hidden as a result of Encapsulation and dealing with them individually.

Polymorphism: As the name implies Polymorphic means to change. Its the methods (instructions) that can process
data differently depending on the circunstance or situation.
 

Glide

Member
Joined
Oct 13, 2003
Messages
103
Seriously this textbook is whacked, the definition for polymorphism sounds like it should be the one for inheritance
 

Ragerunner

Your friendly HSC guide
Joined
Apr 12, 2003
Messages
5,472
Location
UNSW
Gender
Male
HSC
2003
I reckon knowing those definitons are quite useless aside from using it as an opening sentence for your elite band 6 response to come :D.

"The ability to take more than one form"

You should try to understand how it applies to the object oriented paradigm and say how this makes code more re-useable etc..
 

fatmuscle

Active Member
Joined
Jul 6, 2002
Messages
3,707
Location
Hornsby
Gender
Male
HSC
2001
Polymorphism makes possible smooth and easy extension and modification of a program. --> very closely related to inheritance.

don't ask me!!! I failed my OO subjects.
 

Ragerunner

Your friendly HSC guide
Joined
Apr 12, 2003
Messages
5,472
Location
UNSW
Gender
Male
HSC
2003
What did you get ask your HSC mark for SDD fatmuscle?
 

del

Member
Joined
Jul 8, 2002
Messages
412
Gender
Undisclosed
HSC
N/A
as Ragerunner says about many forms....

methods can behave in different ways according to a number of things.
e.g. the type of parameters passed to it - e.g. a ticket machine may accept either coins of notes and return the change. a method may perform the processing differently according to whetehr the user payed with notes, coins or a combo, but it will still return the change

or

say you have an Employee super class and subclasses of it such as Manager and StoreHand. Manager and StoreHand are both Employees as such. However a Manager gets paid more than a StoreHand. a method such as calcPay() can calculate the pay/salary for each of them, even though the processing required is different.

hmm kinda confusing.... but knowledge of overiding and overloading methods makes it easier to understand
 

Cube3

New Member
Joined
Oct 7, 2003
Messages
7
Location
Sydney
from excel SDD:

encapsulation is including all the attirbuts and procedures that an object needs within itself.

you could have an object which isn't encapsulated

for example: an object with x and y values calls an external method and this external method changes the object's own x and y values.

-in encapsulation the object would have that method included in itself and only it would be changing the x and y values.

abstraction allows the programmers to concentrate on the program structure, hiding some of the methods or properties of the object

-this can simplify problems but it can also prevent external code from being changed externally or even view certain properties of an object that may needed to be hidden.

polymorphism is where a behaviour can be acessed by many different objects:
polymorphic routines can be applied to objects of many different types and are encapsulated within a class of objects and could be used by those objects. Such as a special type of window redraw function that a type of object may need to use.


excel is great with definitions
 

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Top