IITDU Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Seeking design pattern assingment details...

4 posters

Go down

Seeking design pattern assingment details... Empty Seeking design pattern assingment details...

Post by BIT0111-muctadir Fri Jan 28, 2011 6:23 pm

Course Name: Design pattern
Course Code: SE 506
Assg Date: 29 jan 2011

I heard the next Saturday we have to submit an assignment to our design pattern teacher. I want to know details about the task. Can anyone help...???
BIT0111-muctadir
BIT0111-muctadir
Expert
Expert

Course(s) :
  • BIT

Blood Group : B+
Posts : 233
Points : 395

Back to top Go down

Seeking design pattern assingment details... Empty Re: Seeking design pattern assingment details...

Post by BIT0112-Rokon Fri Jan 28, 2011 6:35 pm

You have to just implement three behavioral Patterns in you favorite programming language.
they are -
1. Observer
2. Strategy
3. Mediator

thats all.

Note: language should be object oriented. You cant do it in C and Language Like Java ME is not recommended.
BIT0112-Rokon
BIT0112-Rokon
Programmer
Programmer

Course(s) :
  • BIT

Blood Group : O+
Posts : 673
Points : 1269

http://blog.codexplo.org

Back to top Go down

Seeking design pattern assingment details... Empty Re: Seeking design pattern assingment details...

Post by BIT0129-Tabassum Fri Jan 28, 2011 10:20 pm

The first one i.e observer pattern's problem was-

Code:
1. Suppose there are some companies like IBM, Microsoft, Apple etc. These companies have their share price. There are some investors like Suzan, Sharif, Iqbal. They are interested about the share prices of the companies. The investors can register to the companies if they are interested to the share price of a specific company. The investors can unregister if they don’t feel interested any more to a specific company.
When the share price of a company changes, the registered investors are automatically informed about the changed price.

Write a code that shows the above features.


The second one was Mediator pattern. The problem was to make a chat server (simple). The problem was like-

Code:
Make a chat server where a chat room will exits. A user can register but he/she don't have to be logged in(registration is equal to log in system here). User can see who is in the chat room(that means who is in the registered users list.) Message passing will occur between two users through the chat room


Strategy pattern showed by Maeenul sir in the last class. He gave a problem like

In a fighting game there exits many modes to fight. A soldier can fight in aggressive mode, defensive mode, friendly mode etc. Write a program where a soldier can change a mode (We can simply change the mode writing like "Now the soldier is in aggressive mode" ) check the following post by Amit

The first problem was given to students as softcopy. But the next two problems were discussed in class. Neutral


Last edited by BIT0129-Tabassum on Fri Jan 28, 2011 11:07 pm; edited 2 times in total (Reason for editing : to make it correct)
BIT0129-Tabassum
BIT0129-Tabassum
Global Moderator
Global Moderator

Course(s) :
  • BIT

Blood Group : A+
Posts : 1496
Points : 2298

http://probe-tabassum.blogspot.com

Back to top Go down

Seeking design pattern assingment details... Empty Re: Seeking design pattern assingment details...

Post by BIT0122-Amit Fri Jan 28, 2011 10:52 pm

I won't be so sure about the 2nd and 3rd problem description.

In the second problem, user is not required to see who is in chat room. the chat message is required to be sent from one user to another through chat room, which is the mediator.

The 3rd problem is not a fighting game. It is a strategy game. The soldier can have different modes. The commander(in this case, our main class) can change it from one mode to another. If it simply displays, "now the soldier is in ... mode" as Tabassum stated, it won't serve the purpose. Rather, when the fight method will be invoked by a soldier, it will fight in its present mode, showing something like, "Fighting in ... mode"
The difference?
The fight method needs to be used in strategy pattern.
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

Seeking design pattern assingment details... Empty Re: Seeking design pattern assingment details...

Post by BIT0129-Tabassum Fri Jan 28, 2011 11:03 pm

BIT0122-Amit wrote:I won't be so sure about the 2nd and 3rd problem description.

In the second problem, user is not required to see who is in chat room. the chat message is required to be sent from one user to another through chat room, which is the mediator.

Sir told that a user can check the online list or who has been registered Neutral

For the third one yours is accurate Very Happy
BIT0129-Tabassum
BIT0129-Tabassum
Global Moderator
Global Moderator

Course(s) :
  • BIT

Blood Group : A+
Posts : 1496
Points : 2298

http://probe-tabassum.blogspot.com

Back to top Go down

Seeking design pattern assingment details... Empty Re: Seeking design pattern assingment details...

Post by BIT0122-Amit Fri Jan 28, 2011 11:22 pm

For explaining. Yes.
For implementation, nope.
The checking would occur when an user tries to send a message to another user.
checking who is in online list/who has registered, can mean several possible scenarios. But, they won't need mediator pattern implementation.




Edit:

Note: language should be object oriented. You cant do it in C and Language Like Java ME is not recommended.

Muhahahahaa!!! :p nice one.

BTW, design pattern is used in only OOL as far as I know.
BIT0122-Amit
BIT0122-Amit
Founder
Founder

Course(s) :
  • BIT

Blood Group : O+
Posts : 4187
Points : 6605

https://iitdu.forumotion.com

Back to top Go down

Seeking design pattern assingment details... Empty Re: Seeking design pattern assingment details...

Post by Sponsored content


Sponsored content


Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum