• Home
  • RSS Feed
  • Log in

Posts Tagged ‘equals’


Declarative equality for your business domain objects
Posted by Andrew Phillips mid-afternoon: April 24th, 2009

As Josh Bloch writes, for business objects, “overriding the equals method [is] necessary to satisfy programmer expectations.” (Effective Java, item 7). Apart from benefits he mentions – conformance to expectations, correct use in maps and sets etc. – I’ve found that implementing equals (and hashCode) really make you consider what the classes represent. Certainly for business objects, i.e. objects in your domain model, trying to define a business-level identity for your classes is a good way of validating that you’ve correctly captured a business-relevant concept.

An equals definition can also serve as a useful piece of documentation describing your domain. Here, we’ll consider an approach that tries to do this as cleanly and conveniently as possible…declaratively! (more…)

Share

Tags: business key, domain object, equals, hashcode, Java
Filed under Java | 4 Comments »


Xebia Sites

  • Xebia Corporate
  • Xebia France
  • Xebia India
  • Xebia Sweden

Categories

  • Java (311)
  • Agile (181)
  • General (136)
  • Scrum (67)
  • Architecture (64)
  • Testing (59)
  • Performance (46)
  • Middleware (56)
    • Deployment (38)
  • Xebia Labs (39)
  • SOA (31)
  • Podcast (31)
  • Project Management (28)
  • Tools (26)
  • Uncategorized (20)
  • lean architecture (20)
  • Quality Assurance (17)
  • Articles (13)
  • Requirements Management (13)
  • Virtualization (19)

Tag Cloud

    Spring Eclipse Frameworks SOA ACT XML Concurrency Control Moving to India Scala agile architectuur Agile Hibernate Flex Grails Java TDD JPA implementation patterns Javascript Lean Scrum Architecture JPA lean architecture Maven Oracle lean architectuur Ajax Groovy product owner Xebia

Archives

  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011
  • August 2011
  • July 2011
  • June 2011
  • May 2011
  • April 2011
  • March 2011
Avatars by Sterling Adventures