Welcome! Log In Create A New Profile

Advanced

Assignment 3 Visitor Pattern

Posted by rezrovs 
Announcements Last Post
Announcement SoC Curricula 09/30/2017 01:08PM
Announcement Demarcation or scoping of examinations and assessment 02/13/2017 07:59AM
Announcement School of Computing Short Learning Programmes 11/24/2014 08:37AM
Announcement Unisa contact information 07/28/2011 01:28PM
Assignment 3 Visitor Pattern
August 18, 2010 11:35AM
I've gotten myself confused.

So I have a gui that when you press a button, a method on the OperationsOnMembers class is called which generates a QList of the unpaid members. The list is passed back to the gui method and the list is written to a file.

Now I know I need to convert this to the visitor pattern. What I'm struggling with is that the logic is already completely separate from Member and MemberList by being in the OperationsOnMembers class. Am I supposed to make another class called MemberVisitor or something like that?

Any thoughts would be greatly appreciated smiling smiley
Re: Assignment 3 Visitor Pattern
August 18, 2010 12:20PM
I don't think I'm going to use the OperationsOnMembers suggested class. It just makes things less understandable in my opinion.
Re: Assignment 3 Visitor Pattern
August 18, 2010 12:33PM
Yeah, I agree with that. It makes far more sense to keep those methods connected to the member list class in my opinion. The reason I stuck with the OperationsOnMembers class is because they specifically list it and I'm nervous of deviating too far from what they ask for since I'm deviating in other areas.

For example, the user selects the member they want to delete from a list instead of entering a member id at the moment. It made more sense from a user perspective.

Plus the whole part about validating passwords. I understand that they want us to use regex, but if there are clear defined restrictions on usernames and passwords then why allow the user to enter them at all anyway. So for that part I'm setting the values programatically, but still running them through a validator just so that I can tick that requirement off the list.
avatar Re: Assignment 3 Visitor Pattern
August 18, 2010 01:07PM
I've got a Member , MemberList and OperationsOnMembers classes. My MemberReader class reads the file, create members and populates the MemberList.

My OperationsOnMembers class has 2 functions, "static QList<Member*> *getUnpaidMembers()" and "static Member* findMember(QString memID)" I use them

get the unpaid members and finding a member using the memberID.

I've also hardcoded the password and username, but with a extra week I can do the password part..smiling smiley
Re: Assignment 3 Visitor Pattern
August 18, 2010 03:14PM
Hmm. I only have passwords and usernames for the Regional Administrators. Do you have them for the members?
avatar Re: Assignment 3 Visitor Pattern
August 18, 2010 09:31PM
No, what I meant was, the usernames and passwords are coded in, and not in a separate text file.

The more difficult part for me was getting the correct file to be read when the different people logged on(eg. region01, region04,etc)
Re: Assignment 3 Visitor Pattern
August 20, 2010 11:57AM
@rez: the assignment lists national/regional administrators and exhibition organizer to require password to login. No need for members, members are like customers, no need for them to access this application.

Do you guys understand the visitor pattern? I was going through the wiki version of visitor pattern which is very different from what I've read in the text. But I didn't read the visitor pattern revisited section, maybe something of a visit() mentioned there.
Sorry, only registered users may post in this forum.

Click here to login