Hi,
My programming experience is mostly in ASP & PHP, but I will be asked soon to work with
Java (probably
JSP and
servlets). I've started studying, and now I want to build a sample application for my own learning purposes. I chose an application that I built in PHP, and decided to convert it to Java.
As you may have guessed, I'm new to OO, even if I have the
SCJP for 1.4. Therefore, I need a little help with the design of my application. The application is something we use on our portal to maintain links suggested by our members.
A member may suggest a link, and the administrator will approve, modify or reject it. The admin may also create, modify and delete links in the db. In addition, before a link is created, the app must check if the link already exists in the db, and if it does, give the admin the chance to synchronize the information (maybe changing the title of the web site).
Would you please have a look at the rough sketch of classes below and give me your opinion?
super-class:
Link -title
-url
-category
-description
-createLink()
sub-class:
MemberLink -isApproved
sub-class:
AdminLink -deleteLink()
-modifyLink()
-approveSubmittedLink()
-rejectSubmittedLink()
-synchronizeLink()
-------------------------
What I'm not too sure about is the sub-class AdminLink. For example, the only difference between deleteLink() and rejectSubmittedLink() is that deleteLink() deletes a link that was already approved, while rejectSubmittedLink() deletes a link that was never approved. Should they be two separate functions?
I don't think so because the functionality is almost the same...
Any comments/suggestions would be deeply appreciated.
Thanks,
Marie