• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

[Moment-interval pattern] Mapping to code

 
Ranch Hand
Posts: 782
Python Chrome Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
With reference to the UML diag available at
http://raverun.com/javaranch/moment-interval.jpg ;
I need help on mapping this to actual code.
From my understanding; the moment-interval pattern models
an event happening at a particular instance. Thus
"Performance" is the hub of the design while the other
entities are its spokes. In order to model all the relations;
I have something like this:

The question: I also have entities "Race" and "Event".
An "Event" will consists of 1 or more "Race"(s). And there
will be multiple categories in a "Race". Each category
will be associated with a collection of "MarathonPerformance"(s). If "Category" aggregates the "MarathonPerformance" collection; then I still have redundant "Category" members in each "MarathonPerformance" class. What am I doing wrong here ?

Thanks
Pho
 
Sheriff
Posts: 17710
302
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One thing you don't want to do when modeling is to include details that do not pertain to the problem. So, before trying to see what you are doing wrong (if anything), it might help if we understand what you are trying to do before suggesting alternatives.

------------------
Junilu Lacar
Sun Certified Programmer for the Java� 2 Platform
 
A day job? In an office? My worst nightmare! Comfort me tiny ad!
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic