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
  1. DZone
  2. Coding
  3. JavaScript
  4. Finding the Right Metaphors

Finding the Right Metaphors

Developing software is ultimately about communication. Finding a way to communicate ideas will help your team develop better code.

David Bernstein user avatar by
David Bernstein
CORE ·
Mar. 27, 17 · Opinion
Like (3)
Save
Tweet
Share
3.28K Views

Join the DZone community and get the full member experience.

Join For Free

In his book, Domain Driven Design, Eric Evans said that there really is no such thing as complexity, as complexity happens when we diverge from our models or when we use metaphors inconsistently, and I tend to agree. Very involved systems can be easy to understand as long as they adhere to an appropriate set of metaphors.

So how do we find the right metaphors for the problem at hand?

It’s actually easy because we naturally think in metaphors, to begin with. Any problem we express is already defined in some form of abstraction or metaphor, so our primary task is to group different pieces together in ways that make sense to us. We do this by simply asking, “What is the same about these different pieces?” and “What is different about them?”

If we think from the user’s perspective we can often get a good sense of the domain model and then drive down to implementation. Design patterns can be used to group concepts in ways that support our goals.

I have an architectural pattern I use related to this that I called “the three layer DIP” (DIP stands for dependency inversion principle). The application or domain layer is the top level, below that is the services layer, and below that is the platform layer. The idea is that the domain layer only makes calls to the services layer and the services layer only makes calls to other services or the platform. For many kinds of applications, this is a good framework to work within because it makes the domain model clear at the application layer.

The metaphors we use in an object-oriented system are composed of objects. Every object in the system should have its own perspective in the world and should know only enough to accomplish its specific tasks. Separating out perspectives in software gives us the ability to hide different parts of the system so we can make changes without those changes rippling out into other parts of the system. This limiting of knowledge gives software the ability to be more changeable.

Of course, metaphors mean nothing to a computer, but the primary goal of writing software isn’t to make a computer do something, that’s secondary. The primary goal of writing software is to communicate our designs to other developers. Since the dawn of civilization, metaphors have been one of the most powerful ways to communicate ideas. Incorporating metaphors in our software designs helps us communicate complex ideas in our code.

Domain model Software application Design Architectural pattern Computer Express Task (computing)

Published at DZone with permission of David Bernstein, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Top Five Tools for AI-based Test Automation
  • Unleashing the Power of JavaScript Modules: A Beginner’s Guide
  • What Java Version Are You Running? Let’s Take a Look Under the Hood of the JDK!
  • Distributed SQL: An Alternative to Database Sharding

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: