• 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
  • Liutauras Vilda
  • Tim Cooke
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Devaka Cooray
  • Ron McLeod
  • paul wheaton
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Frits Walraven
  • Scott Selikoff

What is called abstractly coupled?

 
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I came across with one line that is "The classes are abstractly coupled"!


Can somebody please give me example of this is this statement is really worth of!



Thanks,
cmbhatt
 
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Check it out here...

http://www.inf.ucp.br/profs/tavares/2002_01/1-02.pdf


Abstract coupling
The purpose of an abstract classes A is to provide a signature so that other
pieces of software, such as a component B, can be implemented based on the
signature of A. B relies on the signature supported by the abstract class; that
is, B is abstractly coupled with the abstract class A. In an adapted framework
an implementation for the signature of the abstract class A is provided through
a concrete subclass A1, which the component B does not know of. Most
important, these components interact properly, that is, without change and
recompilation, with instances of all future extensions of the abstract classes.

 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Megha for replying this deserted thread.

First paragraph goes to my brain without any if and but.
But some if but is there with the remaining para...


In an adapted framework
an implementation for the signature of the abstract class A is provided through
a concrete subclass A1, which the component B does not know of. Most
important, these components interact properly, that is, without change and
recompilation, with instances of all future extensions of the abstract classes.



Following is what I could manage to grasp:

It means you need not to worry if the Abstract class is modified; with the references of the abstract class all the concrete implementations interact seamlessly regardless of any future extensions in the abstract class.


Please give a focus on it!
 
megha joshi
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Chandra,

I think you are right except for the change I think below...

It means you need not to worry if the Abstract class is modified(should be extended not modified); with the references of the abstract class all the concrete implementations interact seamlessly regardless of any future extensions in the abstract class.

Interfaces are like abstract classes, except for some technical differences....I guess Its same as programming to the interfaces where we dont rely on the concrete implementation ...just the method signature is used to implement our class. Thus when we program a class based on the methods found in the interface or abstract class....I think our class is abstractly coupled with it. In other words , only if the abstract class defination changes or the interface changes , then there is a chance our implementation would be affected. Our implementation would not be affected...no matter how many times the abstract class is extended and its methods overridden by the other classes. They all follow the same signature of the methods that we use from the abstract class.

I can't think of a good code example...
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
OK Megha,

You means extension of abstract class.
I think extending an interface means simply creating another interface that will have methods from the previous interface through "extends"

SortedSet extends Set

It means all the concrete implementation which were implementing Set wont be affected from the Set extension. But from now whichever class implement the SortedSet interface will have added benefit of keeping the objects in sorted order.

Abstractly coupled means the concrete class is under the obligation to implement the abstract class methods (abstract methods of course). And in case of future extension of the class (as you said) it will go on running without any problem because nobody is going to change the existing abstract class (adding abstract methods to it only); thus breaking the code of world.(IN every nook and corner, we would have to implement those methods). A new abstract class will be introduced that extends the existing abstract class to enhance the feature. I find so many classes around our API's.

Is that OK Megha?
 
megha joshi
Ranch Hand
Posts: 206
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes you are right
 
Without deviation from the norm, progress is not possible - Zappa. Tiny ad:
the value of filler advertising in 2021
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic