Business Object Model Design
Hello Evryone,
I'm designing a new application for Incident Management.
There is an existing Incident System But, our application is targeted to end user facility.
So, we have to use the existing Incident Management system to store and get data, so that Incident can be loaded on booth side.
We access that datastore using WebServices with DAO Pattern.
In the existing system, they have Incident Attribute like Status, Alert, Priority,... with Integer as main identifier.
publicclass IncidentStatus{
privateint status;
private String statusStr;
public IncidentStatus (){
}
}
In my application, i would like to have a good OO Model.
So, my idea is to use the Design Pattern "State" and/or "Strategy" for such a attribute.
So that i would have class/interface such as
- IncidentStatus (interface)
- IncidentOpened (impl)
- IncidentResolved (impl)
and so on ...
This involve a class for each case but, isn't it more OO oriented ?
any comment ?
Regards,
Sebastien Degardin
[1420 byte] By [
sdegardina] at [2007-11-26 20:45:41]

# 3
but do these IncidentStatus objects do anything other than represent the status? if not, I'd be inclined to agree with the other poster about enumerated types. if adding new ones dynamically is your bag, you could opt for having a single IncidentStatus class, and have instances which represent different statuses, described by (for instance) a String
another question to ask yourself is "how likely is it that I'll need to add a new IncidentStatus?". probably not very often. in any case, if the purpose of the IncidentStatus is merely to indicate status, I'd be looking to have just one class to represent them, and a config file which describes the individual statuses. adding a new one wouldn't even need to involve a programmer
# 4
Hi georgemc,
I'm not planning to use those Objects as "Strategy", it means, nothing else than representing the status.
So, i think the solutino to only use one class alogn with a configuration file would be suitable and preferable in my case.
new status are not going to be added often.
It's just because i'm trying to create a "scalable" model and i need to find the right balance ... :D
Regards,
Sebastien Degardin