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
Partner Zones AWS Cloud
by AWS Developer Relations
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
Partner Zones
AWS Cloud
by AWS Developer Relations
  1. DZone
  2. Data Engineering
  3. Databases
  4. Your Cross-Cutting Concerns are Someone Else's Core Domain

Your Cross-Cutting Concerns are Someone Else's Core Domain

Cyrille Martraire user avatar by
Cyrille Martraire
·
Sep. 08, 10 · Interview
Like (0)
Save
Tweet
Share
5.73K Views

Join the DZone community and get the full member experience.

Join For Free

consider a domain, for example an online bookshop project that we call buycheapbooks. the ubiquitous language for this domain would talk about book, category, popularity, shoppingcart etc.

business domains

from scratch, coding this domain can be quite fast, and we can play with the fully unit-tested domain layer quickly. however if we want to ship, we will have to spend several times more effort because of all the extra cross-cutting concerns we must deal with: persistence, user preferences, transactions, concurrency and logging (see non-functional requirements ). they are not part of the domain, but developers often spend a large amount of their time on them, and by the way, middleware and java ee almost exclusively focus on these concerns through jpa, jta, jmx and many others.

on first approximation, our application is made of a domain and of several cross-cutting concerns. however, when it is time to implement the cross-cutting concerns, they each become the core domain -a technical one- of another dedicated project in its own right. these technical projects are managed by someone else, somewhere not in your team, and you would usually use these specific technical projects to address your cross-cutting concerns, rather than doing it yourself from scratch with code.

technical domains

for example, persistence is precisely the core domain of an orm like hibernate . the ubiquitous language for such project would talk about data mapper , caching, fetching strategy (lazy load etc.), inheritance mapping ( single table inheritance , class table inheritance , concrete table inheritance ) etc. these kinds of projects also deal with their own cross-cutting concerns such as logging and administration, among others.

logging is the core domain of log4j , and it must itself deal with cross-cutting concerns such as configuration.

domain_ccc1

in this perspective, the cross-cutting concerns of a project are the core domains of other satellite projects, which focus on technical domains.

hence we see that the very idea of core domain vs. cross-cutting concerns is essentially relative to the project considered.

note, for the sake of it, that there may even be cycles between the core domains and the required cross-cutting concerns of several projects. for example there is a cycle between a (hypothetical) project conf4j that focuses on configuration (its core domain) and that requires logging (as a cross-cutting concern), and another project log4j that focuses on logging (its core domain) and that requires configuration (as a cross-cutting concern).

conclusion

there is no clear and definite answer as to whether a concept is part of the domain or whether it is just a cross-cutting concern: it depends on the purpose of the project. there is almost always a project which domain addresses the cross-cutting concern of another.

for projects that target end-users, we usually tend to reuse the code that deals with cross-cutting concerns through middleware and apis, in order to focus on the usually business-oriented domain, the one that our users care about. but when our end-users are developers, the domain may well be technical.

from http://cyrille.martraire.com/2009/12/your-crosscuttingconcerns-are-someone-else-core-domai/

Cross-cutting concern Inheritance (object-oriented programming) Java EE Database Scratch (programming language) dev Log4j Persistence (computer science) Middleware

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Chaos Engineering Tutorial: Comprehensive Guide With Best Practices
  • Old School or Still Cool? Top Reasons To Choose ETL Over ELT
  • Building Microservice in Golang
  • Mocha JavaScript Tutorial With Examples for Selenium Testing

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: