Mainframes run the world

Despite the excitement that has surrounded the Web and new programming models like Java and J2EE (as well as Microsoft’s .NET), older, less ‘trendy’ technologies account for the vast bulk of computer processing today.

IBM and the mainframe

IBM is the leading mainframe vendor, with over 70% market share. Therefore, while this report covers the global mainframe market – it is largely dominated by IBM.

IBM is committed to its mainframe technology

the recent release of the z/os demonstrated the fact that IBM is committed to supporting its existing clients and sees a long-term future in the platform. IBM has invested well over $1 billion in developing the z/os .

The future of the mainframe

This reports says that over the next five years the number of individual mainframe machines will fall, but the total number of deployed MIPS will continue to rise.

Key messages

The mainframe is alive and well as a platform for very large workloads.

Saturday, November 17, 2018

Decorator Design Pattern C++

 

In object-oriented programming, the decorator pattern is a design pattern that allows behavior to be added to an individual object, dynamically, without affecting the behavior of other objects from the same class.

 

 

 

 

 

 

#include<iostream>

using namespace std;

 

class pizza{

                public:

                virtual string getdescription() =0;

                virtual int price() = 0;

};

 

class plainpizaa:public pizza{

                public:

                virtual string getdescription()

                {

                return "plain pizza";       

                }

 

                virtual int price()

                {

                                return 5;

                }

};

 

class pizzaDecorator:public pizza{

protected:

                pizza *m_pPizza;

 

public:

                pizzaDecorator(pizza *_piza):m_pPizza(_piza){}

 

                virtual string getdescription()

                {

                                return m_pPizza->getdescription();;       

                }

 

                virtual int price()

                {

                                return m_pPizza->price();

                }

};

 

class tomato:public pizzaDecorator

{

public:

                tomato(pizza *_pizza)

                                :pizzaDecorator(_pizza){}

 

                string getdescription()

                {

                                string temp = m_pPizza->getdescription();

                                temp +="Tomato";

                                return temp;

                }

                int price()

                {

                                return m_pPizza->price() + 2;     

                }

};

class cheese:public pizzaDecorator

{

public:

                cheese(pizza *_pizza)

                                :pizzaDecorator(_pizza){}

 

                string getdescription()

                {

                                string temp = m_pPizza->getdescription();

                                temp +="cheese";

                                return temp;

                }

                int price()

                {

                                return m_pPizza->price() + 1;     

                }

};

 

int main()

{

 

                pizza *p = new tomato(new cheese(new plainpizaa()));

                cout<<p->price();

               

                return 0;

}

Command design pattern in C++

Definition By Wiki:

Command pattern. In object-oriented programming, the command pattern is a behavioral design pattern in which an object is used to encapsulate all information needed to perform an action or trigger an event at a later time.

There are 2 examples in the below given code one with the device and other with stock buy,sell order

// cmd pattern decouples the commands and the underlying object

// you just need to pass the underlying concrete object on which you want to call the command

// to the command concrete object

//

#include<iostream>

using namespace std;

//#define TV_EXAMPLE

#define STOCK_ORDER

#ifdef TV_EXAMPLE

class cmd{

public:

virtual void execute()=0;

};

class device{

public:

                virtual void on() = 0;

                virtual void off() = 0;

                //virtual void volincrease() = 0;

                //virtual void voldcrease() = 0;

};

class tv:public device{

public:

                void on()

                {

                cout<<"TV on";

                }

                void off()

                {

                cout<<"TV off";

                }

};

class on:public cmd{

public:

                on(device *_d):d(_d){}

                device *d;

void execute()

{

                d->on();

}

};

class off:public cmd{

public:

                off(device *_d):d(_d){}

                device *d;

void execute()

{

                d->off();

}

};

Sunday, November 11, 2018

C/c++ compilation process detailed