Win a copy of Fixing your Scrum this week in the Agile forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Rob Spoor
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Holloway
  • Piet Souris
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Frits Walraven
  • Himai Minh

Usage of abstract class on various design pattern point of view

 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ranchers,

Could anyone give me some link or help me out to understand the exact usage of abstract classes in various design patterns. Or help me to understand the usage of interfaces and abstract classes (or rather there differences) from various design pattern point of view.

Any kind of help is highly appreciated.

Soumayajit
 
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Soumyajit Hazra wrote:Hi Ranchers,

Could anyone give me some link or help me out to understand the exact usage of abstract classes in various design patterns.



For that you'd have to look at the individual patterns and see which ones use an abstract class and how they use it. Google is your friend here.

Or help me to understand the usage of interfaces and abstract classes (or rather there differences) from various design pattern point of view.



This too is the kind of question where you should SearchFirst.(⇐click) There's plenty of information readily available to answer these general questions. After you've spent some time studying it, if you have a more specific question, post again.
 
Soumyajit Hazra
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Jeff. I do searched it in google and found that in Template Design Pattern,Factory Pattern we are using abstract classes. Please correct me if I am wrong. I mainly want to get the differences between interface and abstract class from design pattern point of view. I understand its a very general question but I'll be great full if anyone pick any one pattern and give me some explanation w.r.t that pattern only.
 
Ranch Hand
Posts: 136
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Soumyajit Hazra wrote:Thanks Jeff. I do searched it in google and found that in Template Design Pattern,Factory Pattern we are using abstract classes. Please correct me if I am wrong. I mainly want to get the differences between interface and abstract class from design pattern point of view. I understand its a very general question but I'll be great full if anyone pick any one pattern and give me some explanation w.r.t that pattern only.



You can search this forum for this question. It has already been answered. But just to add,
Abstract class defines something concrete, which is the parent of a particular object, but is too vague to be instantiable.

Eg
Animal(Abstract)-> Person (abstract) -> Man/Woman (concrete). These classes can have certain behaviors(in the form of methods) defined, but lack certain others, which stop them from being concrete
.

Interfaces are merely a collection of behaviors which a particular class must exhibit in its own way. Eg Swimmable, Breathable.

The hierarchy in abstract classes is linear. Where as, in interfaces, we can group two unrelated classes based on some common behavior.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic