[jopr-dev] Event constructor question

John Mazzitelli mazz at redhat.com
Wed Jan 28 01:13:03 EST 2009


I have a question about the Event domain object API. It has these two 
constructors:

public Event(String type, String sourceLocation, long timestamp, 
EventSeverity severity, String detail)   
public Event(String type, String sourceLocation, long timestamp, 
EventSeverity severity, String detail, *EventSource source*)

I'm questioning that second one.  If we accept an EventSource as the 
last argument, can't we then infer the values of "type" and 
"sourceLocation" and thus shouldn't that constructor be:

public Event(long timestamp, EventSeverity severity, String detail, 
EventSource source) {
   this.type = source.getEventDefinition().getName;
   this.sourceLocation = source.getLocation();
   ...
}

Otherwise, what prohibits type and sourceLocation parameter values from 
(accidentally) being DIFFERENT than that which is found in the given 
event source (and if that happens, I assume that would semantically be 
wrong).

???



More information about the jopr-dev mailing list