Back to list
Views:   0
Replies:  0
Archived
,
5. Write FinancialService that will create above obejcts 2,3 and 4. add 2,3 to object 4. then set gold price and call 4.Notify(). 6. U can have two/ three methods that effect gold price icrease 4%, decrease 5%, etc.. 7. write a NUNIt that will call FinancialService class and would check if code written in classes 2,3 has been executed. Project 2 will do exactly same, however.there will be a delegate obejct global and each class will implement method as per delegate implementation. using multcast delegates add methods of classes in order. In financial service class, invoke the delegate using event and same things will happen . U would have to read delegate, multicast delegate and events to do this.
May 17, 2012
Hi, For first project u need to: 1. Create a interface IGoldConsumer with method Update 2. Create a class say CommodityFund that will inherit from IGoldConsumer and in update method, allocate funds if price drops beyond say 2% and sells if price goes above 2% (stragegy to invest) 3. Create another class say BuyGiftForWife that will inherit from IGoldConsumer that will order gold for wife if price goes lesser than say 10000 INR. 4. CReate a class called PriceObserver, that will have method Add accepting IGoldConsumer type param and remove having IGoldConsumer type param. Define local variable List and instantiate it in connstructor. in add method add obect to list , in remove method check and remove from list. In Notify method. foreach IGoldConsumer just call IGoldConsumer.Update().
May 17, 2012
Stay Inspired!
Join other developers and designers who have already signed up for our mailing list.
Terms     Privacy     Licensing       EULA       Sitemap      
© Data & Object Factory, LLC.
Made with    in Austin, Texas