Menu

#6 Use interfaces instead of classes

open
None
5
2002-09-25
2002-01-27
No

We are trying to work with interfaces where possible.
Handing over parameters in method headers etc. is
done with interfaces.

Many of Scope's methods require classes to be handed
over. This is somewhat unpractical to us since we
have to cast down all our parameters before handing
them over to Scope, e.g.:

private ResMenu
createApplicationMenu(ResMedicinaeView v) {
...
ResMenuItem exitSystemMenuItem = new ResMenuItem();
exitSystemMenuItem.setOwner((ResMedicinaeViewImpl) v);
...
}

It would be nicer, if we could just write:
exitSystemMenuItem.setOwner(v);

--
This request shouldn't bother other people who have
already used Scope with classes as parameters. Since
those classes inherit from "View", they can be handed
over as "View" from method to method - no changes
necessary.
For us, on the contrary, it would be much easier to
work with our interfaces.

Regards & Thanks,
Christian

Discussion

  • Waily

    Waily - 2002-04-05

    Logged In: YES
    user_id=119697

    This will be useful for JMX ..

     
  • Ludovic Claude

    Ludovic Claude - 2002-09-25

    Logged In: YES
    user_id=254624

    This would mean:
    - SwingView: refactor as an interface
    - AbstractSwingView: the base class implementing SwingView
    I put that as a todo for release 1.1

     
  • Ludovic Claude

    Ludovic Claude - 2002-09-25
    • assigned_to: nobody --> ludovicc
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.