DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
What's in store for DevOps in 2023? Hear from the experts in our "DZone 2023 Preview: DevOps Edition" on Fri, Jan 27!
Save your seat
  1. DZone
  2. Coding
  3. Frameworks
  4. Rant: Who Designs These UI Frameworks Anyway?

Rant: Who Designs These UI Frameworks Anyway?

Richard Kennard user avatar by
Richard Kennard
·
Dec. 01, 10 · Interview
Like (0)
Save
Tweet
Share
8.96K Views

Join the DZone community and get the full member experience.

Join For Free

I've been working with a few different UI frameworks lately as part of building Metawidget, and I've noticed something...

Building Consensus

First let me state some things I hope we can all agree on:

  • Rule 18 of Effective Java: Prefer interfaces to abstract classes
  • Rule 16 of Effective Java: Favor composition over inheritance
  • The industry trend toward POJO-based development is a positive one

If you accept all these, then I have a shock for you: most UI frameworks ignore them. Oh sure, UI frameworks love defining interfaces for you the developer to have to pass them (MouseListener, SystemEventListener etc) but when it comes to adhering to these rules themselves, internally? Not so much.

Swing of Doom

Here's the challenge: how come hardly any UI frameworks define their widgets in terms of interfaces, as opposed to abstract base classes? Why isn't, say, Swing's JComponent an interface? By all means have a JComponentImpl as a convenience class, but don't force me to extend from it. Many programming languages use single-shot inheritance, so if you constrain my single-shot I'm screwed if I want to develop, say, some cross-platform UI functionality or a composite component without putting everything inside a JPanel.

It's Not Just Me, They're All Doing It!

Sure you could argue this is a corner-case, and that Swing predates much of the modern wisdom, but just look at this list:

Framework Base Interface?
SwingJComponentNO
AWTComponentNO
SWTWidgetNO
JSFUIComponentNO
WicketComponentNO
AndroidViewNO
JavaFXNodeNO
FlexUIComponentNO
GWTUIObjectNO
Spring MVCAbstractFormTagNO
ASP.NETControlNO
PivotComponentNO

Where are the lightweight, POJO-based, interface-based (or even, gasp, annotation-based) UI frameworks?

A Shining Example To Us All

A twist to the tale: I did manage to find one UI framework that implements its base widget using an interface. What is this enlightened, cutting-edge, modern framework you ask? Why plain ol' Java Server Pages of course! Its base Tag is an interface, with convenience class TagSupport. JSP, eh? Before its time or what :)

Framework

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Load Balancing Pattern
  • How to Develop a Portrait Retouching Function
  • Spring Cloud: How To Deal With Microservice Configuration (Part 1)
  • Why Does DevOps Recommend Shift-Left Testing Principles?

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: