mmaz
Programmer
- Nov 22, 2000
- 347
Hi there,
I have to build a simple application (used by less than 10 people) that must run on Linux and Windows, so I've decided to use Java. We do not have a designer here, so I have to do the Analysis and design. I know the concepts of OOAP, but I'm having a bit of trouble to identify the classes and their methods.
I was hoping that somebody could help me with this (I'm the only programmer in my organization).
Basically, we have a directory of companies, and the administrator should have the ability to maintain the directory (add, modify and delete companies). A few different surveys were also given to some of these companies and the regular users want to be able to look at the surveys results and look at each company's answers.
I have identified 5 classes, Company, Survey, Employee, Administrator and User:
--------------------------------------
class Company
- Behaviors: maintain company details
- Properties: name, address, phone, number of employees...
class Survey
- Behaviors: search survey results
- Properties: name, questions, answers
class Employee
- Behaviors: authenticate
- Properties: id, name, role
class Administrator extends Employee
- Behaviors: maintain companies
- Properties:
class User extends Employee
- Behaviors: search companies
- Properties:
---------------------------------------
Would somebody be kind enough to comment this? I know it's not right. I have trouble separating the responsabilities of a person and those of an object.
Where should I put the methods addCompany, modifyCompany, deleteCompany and searchCompany? These goes in the Company class, right?
Any help would be greatly appreciated!
Thanks in advance,
Marie
I have to build a simple application (used by less than 10 people) that must run on Linux and Windows, so I've decided to use Java. We do not have a designer here, so I have to do the Analysis and design. I know the concepts of OOAP, but I'm having a bit of trouble to identify the classes and their methods.
I was hoping that somebody could help me with this (I'm the only programmer in my organization).
Basically, we have a directory of companies, and the administrator should have the ability to maintain the directory (add, modify and delete companies). A few different surveys were also given to some of these companies and the regular users want to be able to look at the surveys results and look at each company's answers.
I have identified 5 classes, Company, Survey, Employee, Administrator and User:
--------------------------------------
class Company
- Behaviors: maintain company details
- Properties: name, address, phone, number of employees...
class Survey
- Behaviors: search survey results
- Properties: name, questions, answers
class Employee
- Behaviors: authenticate
- Properties: id, name, role
class Administrator extends Employee
- Behaviors: maintain companies
- Properties:
class User extends Employee
- Behaviors: search companies
- Properties:
---------------------------------------
Would somebody be kind enough to comment this? I know it's not right. I have trouble separating the responsabilities of a person and those of an object.
Where should I put the methods addCompany, modifyCompany, deleteCompany and searchCompany? These goes in the Company class, right?
Any help would be greatly appreciated!
Thanks in advance,
Marie