Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

abstract class vs. interface (coursework)

Posted on 2011-04-20
11
Medium Priority
?
527 Views
Last Modified: 2012-05-11
Experts,

Need expert comments on Abstract class vs Interface, i need full description covering ,

1. all the differeces between abstract class and interface
2. advantages, disadvantages of both
3. which scenario to use one or the other
4. Can abstract class contain constructor, if so can it be called? same for interface?
I need whole theory part for the both.
0
Comment
Question by:AbhiJeet
9 Comments
 

Author Comment

by:AbhiJeet
ID: 35435897
The theory should be relevant to delphi only.
0
 
LVL 38

Accepted Solution

by:
Geert Gruwez earned 2000 total points
ID: 35435950
this looks a lot like homework

abstract class:
http://www.delphibasics.co.uk/Article.asp?Name=Abstract

interface
http://www.delphibasics.co.uk/Article.asp?Name=Interface

scenario ?
you can always use either

4:
yes it can be called as any class descends from TObject
and this contains a constructor per default
interface is just a placeholder for functions/procedures

0
 
LVL 38

Assisted Solution

by:Geert Gruwez
Geert Gruwez earned 2000 total points
ID: 35435984
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 22

Expert Comment

by:8080_Diver
ID: 35436159
Definitely sounds like either homework or a take-home test. ;-)
0
 

Expert Comment

by:overtheclock007
ID: 35454184
The question you asking makes nosense abstract class are class that only have body and are completly virtual. The only think that is define is the methods names and procedure, function of class.
The abstract class must have in some point a derivation to another where you define procedures and functions vars in and out.

A interface is a completly diferent thing. I will not write more because i think you get the point.

abstract class vs. interface question = MAKES NOSENSE
0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 35481392
there is actually a little sense to it :)

with abstract you can specify which function/procedure must be overridden
it could be just the 1

with interface you need to implement all function/procedure

writing a interface for a thread would be a lot more work than deriving from a abstract class


in essence any class becomes an abstract class if at least 1 member is abstract

0
 
LVL 38

Expert Comment

by:Geert Gruwez
ID: 35708141
aikimark ...
you scared this person away before getting an answer
0
 
LVL 46

Expert Comment

by:aikimark
ID: 35709427
@Geert

We haven't seen a comment since
The theory should be relevant to delphi only.

Open in new window


I doubt my comment scared anyone.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 35892779
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
Screencast - Getting to Know the Pipeline
Suggested Courses
Course of the Month20 days, 16 hours left to enroll

810 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