Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Polymorphic Fun and Games

Posted on 2000-05-08
11
211 Views
Last Modified: 2010-04-04
Ok guys (and wimmin) can anyone out in clever land help me out with polymorphism? I don't have a specific problem as I know zero about the subject, so does anyone know of some good tutorials or examples that can help this brain dead fool at least appear to know what he's talking about in front of his boss

Mucho biggo thanks in advance

The Neil =:)
0
Comment
Question by:TheNeil
  • 3
  • 3
  • 2
  • +3
11 Comments
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2787746
listening . . .
0
 
LVL 7

Expert Comment

by:God_Ares
ID: 2787761
well i can explain it with asm
i hope you know asm

sample:

0F13:0100 B021          MOV      AL,21                              
0F13:0102 00060701      ADD      [0107],AL                          
0F13:0106 CD00          INT      00            

polymorphism is altering the code but let it do the same..
so the first lines you can modify to add 20 to but letting adres 107 be 1

as far as i know polymorphism is only used with asm..  don't forget opcodes are just values between 0 and 255 that are mean somthing..
0
 
LVL 5

Author Comment

by:TheNeil
ID: 2787789
Sorry God Ares

Err what's this? Apologies but I'm not an Assembler guy so it doesn't mean anything to me. I realise what polymorphism is (the ability for a form (or whatever) to act in several different ways) and what I'm stuck on is actually implementing such a system in Delphi. Mastering Delphi 5 gives a brief insight but I was looking for more - This ain't what I was after

The Neil =:(
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 2787808
0
 
LVL 7

Expert Comment

by:God_Ares
ID: 2787831
k i'll explain a bit
at adress
0F13:0106 CD00      INT 00            
this line has 2 bytes
[106]cd  and [107]00
combined they mean int 00

when you execute this code
al will carry the value 21
and 21 will be added whit adres[107] that was 0 but will become 21..
this is called stealth. for polymorphism you can modify eg. adres[101] to 20 and modify adress[107] to 1 the code will do exactly the same.. i hope i have eplained it a bit to you..

don't forget i'm just 19 :)  you should learn the basics of machine programming..

btw polymorphism is mainly used in virr

Greetz

God_Ares
0
 
LVL 5

Author Comment

by:TheNeil
ID: 2787851
God_Ares

Are you sure that you understand what I'm on about in this context? Delphi allows forms with common functionality to be linked via a commmon base class form. I understand the principle involved but there's a distinct lack of actual text and code examples

BTW I'm avoiding learning assembler and the like because a)It's awful (this is a personnal opinion not an insult so please don't take it as one), b)It's not portable, and c)This is 3rd generation coding not 2nd (although I can see what you're saying about understanding the machine at the hardware level)

Meikl: This is more like it. If nothing better comes along then you get the points

The Neil =:)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 2787885
0
 
LVL 2

Expert Comment

by:kotik
ID: 2787944
Hi, TheNeil!

I think, that you are talking about the polymorphism in Object Oriented Programming.
If so, I can advise you to read this book:
G. Booch. Object-Oriented Analysis and Design with Applications, Second Edition. Benjamin/Cummings, 1993

Hope that you can find it's online version.

Regards,
Kot.
0
 
LVL 9

Expert Comment

by:ITugay
ID: 2788474
Hi all,
FlorisB (is it you?) - my applauses, I even can't imagine this way of polymorphism understanding.

-----
Igor.

PS: But if you so like an assembler then you forgot about
1. Even stupid processors have some command cache.
2. Good idea to modify data in code segment. What about protected mode?

0
 
LVL 1

Expert Comment

by:l8knight
ID: 2788478
Basically Polymorphism is about using the same Method name to do different(but similar) things in Inherited objects...e.g.

point = Object
     x: integer
     y: integer
     function getx
     fucntion gety
     procedure display
        end

3dpoint = object(point)
      z: integer
      function getz
      procedure display
          end

because you can not inherit the display procedure from point (it doesn't know how to display the 3rd dimension) you implement it again...

just think of any components .Show method, it needs to re-implemented for each visually different component.

hope I explain it good enough

regards

l8knight
0
 
LVL 5

Author Comment

by:TheNeil
ID: 2788568
Thanks people - I'm starting to wrap my head around this now but kretzschmar was first with a reasonable article which goes in depth a bit more than just explaining what the term means so he gets the points

The Neil =:)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
Creating an auto free TStringList The TStringList is a basic and frequently used object in Delphi. On many occasions, you may want to create a temporary list, process some items in the list and be done with the list. In such cases, you have to…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question