public void UsageMethod()
 {
     int extrinsicstate = 22;
     FlyweightFactory factory = new FlyweightFactory();
     IFlyweight fx = factory.GetFlyweight("X");
     fx.Operation(--extrinsicstate);
     IFlyweight fy = factory.GetFlyweight("Y");
     fy.Operation(--extrinsicstate);
     IFlyweight fz = factory.GetFlyweight("Z");
     fz.Operation(--extrinsicstate);
     UnsharedConcreteFlyweight fu = new UnsharedConcreteFlyweight();
     fu.Operation(--extrinsicstate);
 }
Пример #2
0
        public void UsageMethod()
        {
            int extrinsicstate       = 22;
            FlyweightFactory factory = new FlyweightFactory();
            IFlyweight       fx      = factory.GetFlyweight("X");

            fx.Operation(--extrinsicstate);
            IFlyweight fy = factory.GetFlyweight("Y");

            fy.Operation(--extrinsicstate);
            IFlyweight fz = factory.GetFlyweight("Z");

            fz.Operation(--extrinsicstate);
            UnsharedConcreteFlyweight fu = new UnsharedConcreteFlyweight();

            fu.Operation(--extrinsicstate);
        }