Tuesday, October 18, 2022

The Bragging Rights of a Dad - a Guru in the making of a formidable intellectual Khastriya...

 



An impromptu discussion between a dad- a Guru - and his son - after lunch.

It takes a hell lot of planning, and preparation to create a formidable intellectual Khastriya out of a small boy...

Risky

yet

Challenging

Dedicating my service to the nation

The tree that I am watering and making ready

maybe

one day will help a bunch of tired people to rest beneath himself/itself...

I am just playing the role of a squirrel during the RamSetu construction - under the tutelage of Bhagwan but not exactly looking for anything in return from anybody in this #UNIVERSE.

Look at the level of confidence of an 11-years-old kid writing C++ code. It takes a lot of energy and insights to write this kind of stuff. Now I am in the process of making #ridit move beyond the language level - so that he can realize the big picture and understand it as a senior scientist - not just as a programmer stuck with debugging and all sorts of low-level kinds of stuff.

Let's call a spade a spade - the abyss that is called H1B


Watch this video carefully as this guy is explaining many issues of H1B hurdles and why this should never be the right option for a software engineer in Bharat.


There are many sad, pathetic stories of software engineers who go to the USA on H1B.

Here is a guy giving his understanding of why H1B is not the right choice for a software engineer.

However, there are a hell lot of other problems besides official and legal problems.

In NJ, we have seen some of the software engineers from the Bharat almost becoming blue in sub-zero temperatures - maybe they were not made aware by their office in #Bharat about how cold would be like in the sub-zero temperature?

Then, the legal hassles that the silly office bearers of the USA-based companies of Bharat put in front of the software engineers - who hardly have any idea about the legal rules of the USA and the admin office bearers know it very well.

They threaten stern legal actions if the software engineers can't comply with whatever demands the offices are making.

Then there are issues of illegal bonds and the legal issues that occur because of that.

So, mostly what happens to a software engineer, who does not have a good backbone of friends and relatives at top USA positions is that instead of studying software and making themselves aware of the latest tech, an engineer spends most of the time learning unnecessary legal issues to protect his own a**hole.

Yes. Doston... Mitron...

This is the reality of H1B.

Wednesday, August 31, 2022

The knowledge that was passed to his grandson from his grandfather during a bus journey to Durgapur...

During my childhood days, i had spent a significant amount of time with my grandfather. We used to visit my aunt's home in Durgapur, very often

One day, during our journey by SBSTC (i think the name was different at that time), i was looking through the window and enjoying the strong wind that was coming from the opposite direction.

During that journey, I found, in many of the places, an artificial jungle of the Eucalyptus trees was created.

Wondering, I asked my grandfather

"Dadu, why these artificially made jungles have suddenly popped up here?"

My grandfather then explained the story behind the Eucalyptus tree and wondered why the govt of West Bengal, instead of Saal and Segun trees, are importing this nonsense for the dry soil of Manbhum.

He told me in detail, that why in many places, outside Bharat, the aboriginal peasants hate this tree because it takes so much groundwater that another plantation around this tree suffers.

And he also explained the experimentation of creating such kinds of artificial forests of Eucaliptus trees in the swampy area and the success of such experimentation.

As Google is helping me these days, instead of working as a soil engineering staff, i am presenting the write-up taken from the internet which has a detailed study of this matter from an expert point of view..

But, thanks to my grandfather, I, barely a 10-years-old kid, was enlightened by him during a bus journey

Dadu, you deserved a lot more from this #universe just because of your acumen and insights - a great personality and having so much diversified knowledge about many aspects of the contemporary world.

The sad story of Eucalyptus Tree forestation in the Manbhum Area of Bharat

Taken from the Internet - it has discussed many aspects - neither denying the fact that an Eucalyptus tree drains a lot of water nor completely pooh-poohing the idea of making an artificial jungle of this tree...

A Bad Rap: It Drains Water

Maybe it is precisely due to this universal success of the eucalyptus that so many contrary opinions have emerged regarding it. A number of theories hold that the eucalyptus is a dangerous tree, capable of generating many negative and few positive things, a damned tree. If all these theories were true, Australia, covered with vast eucalyptus forests, would be a dead continent. But, far from that, it is a sanctuary where many species, unique to that environment, have been preserved and thrive.

It is said that the eucalyptus tree absorbs water and dries up land because it needs so much water in order to grow so fast. This is a half-truth. It is true that the eucalyptus absorbs a lot of water like all plants do, but it also uses water more efficiently than other species. The acacia another rapid-growth tree needs a third more water to produce the same amount of wood. But nobody speaks ill of the acacia.

The eucalyptus is also accused of making more difficult the passage of rainwater towards the phreatic or underground level. This is true. But it is also true that any plant species, large or small, absorbs some rainwater as it makes it way down to the groundwater level. The only way to assure that all rainwater descends to the phreatic level would be to not let anything grow at all a not particularly appealing solution.

The eucalyptus consumes less rainwater than it appears to at first, because it has the ability to close up its leaves in such a way that, during droughts, its evaporation transpiration process is dramatically reduced. When it does not rain and the other trees turn yellow and parched, the eucalyptus stays green not because it has enormous reserves of water hoarded away, but because it shuts off the stomas something like the pores on human skin on its leaves, and doesn't allow the water to escape through them. In other words, the eucalyptus doesn't "sweat."

As proof of the fact that the eucalyptus uses lots of water, its enemies point to the fact that this tree is used to dry swamps. The eucalyptus certainly has a powerful root system to support its height a soaring 40 meters, on average. Its roots rarely go beyond 20 meters deep, but they have a very special characteristic. They grow turning downward, drilling through the earth like a corkscrew.

But this is not always bad. Among the many hundreds of varieties of eucalyptus, there are some whose roots are especially strong, and thus capable of eventually drilling through very hard rocks. Sometimes they can even get through that layer of impermeable rock that will not allow rainwater to pass. If they can perforate those rocks, little by little the surface water trickles towards the groundwater through fissures opened up by the roots. It will reappear in some other place, in the form of a spring or well. The eucalyptus doesn't suck swamps dry but rather unclogs their drains. For many decades now, eucalyptus trees have been planted in swampy areas and the water is still there.

Now, here from the Internet, I have got one document about the Saal tree and I am just presenting the researcher's story here  - because I really can't remember what the mote points my grandfather told me about the sanity of the Saal and Segun tree plantation on the dry land of Manbhum.


Enjoy...


Tuesday, August 30, 2022

When the ill-gotten $ blows away the sanity which was left in a moron...


When a billionaire like #hellgates with all of his ill-gotten $ becomes confused about

who the bloody hell is he/she

he/she tries to play around with the 

#motherearth

thinking that maybe it's okay to take charge of all the natural resources provided by #lordshiva

and that he/she has gotten such power to do that.

Such is the effect of having a long nose - nobody warns him not to poke it everywhere 

agar naak katwa jate hai

to bohut dard hotey hai...




Taking a text from a patent application of #ballgates to control nature and why #universe must be careful about these morons.

Truly this is the age of Greenfinger: Billionaire Bill Gates has patented the idea to halt hurricanes by decreasing the surface temperature of the ocean.

The patent calls for a large fleet of specially equipped ships that would mix warm water from the ocean surface with colder water down below, according to five new patents that include Microsoft’s chairman as a co-inventor. That could then reduce or perhaps eliminate the heat-driven condensation which hurricanes feed upon, thus significantly reducing their intensity.

Patent-watcher “theodp” first spotted the new patent filings and told TechFlash that the scheme reminded him of something Mr. Burns might have concocted in “The Simpsons” — if the fictional industrialist hadn’t already blown his master plan on blocking out the sun.

The hurricane-stopper plan was apparently hatched from a meeting of Intellectual Ventures, a patent house that regularly gathers scientists and technologists to brainstorm together. TechFlash notes that the official filings came through an Intellectual Ventures affiliate, Searete LLC.

This represents just the latest in a long line of geoengineering proposals aimed at taming Mother Nature, whether aimed at climate change or hurricanes. Even the prestigious National Academy of Sciences held a workshop in June on geoengineering, although that ended with disagreements on whether the cure might be worse than the problem.

We previously looked at other plans regarding hurricanes, such as sending supersonic jets slicing into the eye of the giant storms. But for now, it’s likely that coastal cities should at least invest in more grounded ideas to become hurricane-proof.


Tuesday, July 26, 2022

Building the perspective of a budding scientist from #bharat - in the lights of #KargilVijayDiwas - #fatherhood rocks...



 

The Pain of a Nation with so much advanced scientific

knowledge during ancient time…

 

The pain of not getting the GPS data from US during Kargril war

and why becoming technologically independent matters for

#bharat

The Manifestation of Pain in creating the perseverance

Why people of Bharat should celebrate about the launch of satellite

navigation system Navic by ISRO?

The perspective for homegrown companies like

MapMyIndia from Navic system

Shall we think about using Navic Data in #bharat

compulsory for every player who want to work in this

field

- The security perspective

- The commercial perspective

 

My learning related to Technologies for such navigation

system

The border between two sets of data -

- For military purpose

- For civilian purpose 


Watch here... we are unstoppable...

Latest news of ISRO/NAVIC system

Key Developments:


- Expansion of NAVIC Coverage: ISRO is working to extend the coverage of NAVIC from 1,500 km to 3,000 km beyond India's borders.

- Integration into Smartphones: Apple has incorporated India's navigation system, NavIC, in its newly launched iPhone 15 Pro models.

- Launch of NVS-01 Satellite: ISRO successfully launched the navigation satellite NVS-01, which is part of the plan to replace older satellites and enhance NAVIC's capabilities.

- Potential for Global Leadership: A report by Deloitte, Nasscom, and the Indian Space Association (ISpA) highlights India's potential to become a global leader in the navigation system market.

Overall, ISRO is actively working to enhance and expand NAVIC's capabilities, positioning India as a significant player in the global navigation system landscape.

Work in progress…


 

Part 2

The latest development in the EV industry and the reason

behind it - joining the dots… 

How this whole development should be taught to the

students - from a scientist of non-sense…

 

We will have to start with - maybe - with this…

 

https://dinesh.locals.com/post/2083099/2000-mules

 

A movie which depicted how Trump sir was preempted from the USA system by a

rouge thread - which acquired higher priority by the help from the

 

global unethical hackers

 

unlike our Hero - the founder of #wikileaks

 

 

And then the #dems were installed in the USA system

 

but with just one camouflage

 

The camouflage of a proxy design pattern…

 

An interface for the outside world - which will be capable of performing all nuisance

staffs including comedy for the global audience but for major political decision -

 

a bigger boss will be there to take charge - and actually nobody will be ble to know -

ye andar ka baat.

 

The great political implementation of

 

Proxy Design Pattern in the modern history…

 

And then the inevitable happened…

 

The USA troops were asked to vacate the Afghanistan - but again with the right kinds of

camouflage so that the act looks pretty good for the human race - at least to brainwash

the global sheepish community - through the idiot boxes fixed by the old sly fox Mr

Soros…

 

And then within the next couple of days - the whole Lithium mines of Afganistan were

under the control of #China -

 

As Lithium was the major material for EV.

 

The global companies - including the USA hero Elon Musk sir -

 

Aab keya hoga re…

 

And hence ….

 

Battery industry leaders answer

lithium shortage fears

Molly Hulsey

By Molly Hulsey

 mhulsey@scbiznews.com

OCT 05, 2021A Nevada lithium mine extracts the mineral from brine pools. (Photo/File)

A Nevada lithium mine extracts the mineral from brine pools. (Photo/File)

Demand from the energy sector began to climb for an auto and aerospace giant, and something had to give.

“Globally, everybody is going to clean energy, and the applications we are going after: it saves them about 30% in total costs of ownership, so this is an enabler for that industry,” Prasad Donti, project leader for Solvay’s thermoplastic capital projects, told GSA Business Report.

The Belgian company produces tapes and other materials made from thermoplastic composites used in several applications, including the construction of aircraft, vehicles and lithium-ion batteries.

After a few delays from COVID-19, the company opened a 27,000-square-foot facility on site of Piedmont’s former Cytec carbon fiber production plant on Sept. 16. The new lines will be used to manufacture unidirectional composite tapes from PVDF, PPS and PEEK thermoplastics.

According to CEO Mike Finelli, the Upstate’s new PVDF tape production line will be used by the oil and gas industries but at Solvay’s other locations, the plastic is shaped to bind battery cathodes, allowing them to stay powered up for longer periods of time.

Following the U.S. withdrawal from Afghanistan — home of what some speculate to be the most lithium-rich deposits on the planet — fears of a lithium shortage and price spike escalated this fall, but Finelli said he doesn’t take stock in those fears. At least not for the lithium market.

Solvay's Evolite unidirectional PVDF tape produced at the Piedmont plant. (Photo/Provided)

Solvay's Evolite unidirectional PVDF tape produced at the Piedmont plant. (Photo/Provided)

“I think the industry will adjust and move as it needs to,” he said. “The concern about lithium itself is not as big of an issue as it was a few years ago.” Especially as Solvay ramps up the use of a battery-recycling process that extracts minerals from used batteries, he said.

 

Most batteries are recycled through a process called pyrolysis, he said, where the batteries are ground up and burned. Minerals like nickel and cobalt can be extracted, but lithium is usually too challenging to save. None of the material is pure enough to be used in a battery again, however.

Solvay’s use of chemicals used during rare earth mining, however, can extract lithium, cobalt, nickel and magnesium from ground-up batteries pure enough for re-use in a battery.

“Now [we’ve] created a real circularity, which is critical for this industry, because ultimately, you want to slow down the mining of these materials,” Finelli told

GSA Business Report.

Critics of the withdrawal from Afghanistan claim the U.S. decision hands Afghan deposits to nations like China, which already operates 73% of all lithium-ion battery production, according to 2020 U.S. Senate testimony from Benchmark Mineral Intelligence.

Diplomatic veterans and industry leaders drive home China’s leg up in the lithium industry, but the jury is still out on the U.S. withdrawal’s impacts on battery manufacturers — and suppliers like Solvay — in the long run.

“China is back to get everything in Afghanistan, and they’re going to get a lot,” said Michael Ussery, former U.S. Ambassador to Morocco and president of one of the founding organizations of the American University of Afghanistan. “They’re dealing with a Taliban that is desperate for money, so we’re going to lose out.”

Building up to 2021, Ford had greased the tracks for lithium mining through concessions with the country and a partnership with a localized mining company. Plans were underway to build a factory in Thailand to produce batteries from the Afghan mined resources, Ussery said.

This was the year Ford would have received the concessions following a bidding process.

“It took us years to figure out how much wealth is under the ground in Afghanistan,” he said. “We should have been figuring that out at the get go.”


 

Solvay officials Prasad Donti and Carmelo Lo Faro discuss the new TPC product lines with Gov. Henry McMaster at the new Piedmont facility. (Photo/Molly Hulsey)

Solvay officials Prasad Donti and Carmelo Lo Faro discuss the new TPC product lines with Gov. Henry McMaster at the new Piedmont facility. (Photo/Molly Hulsey)

Some industry professionals question whether dated Soviet geologic records or aerial photographs of the country can be trusted in the quest for the rare earth mineral.

 

“To suggest Afghanistan’s lithium is a pot of gold for the Taliban, China or anyone else is just incorrect,” Simon Moores, managing director of Benchmark Mineral Intelligence, said in a statement following the U.S. withdrawal from Afghanistan.

The U.S. is already far behind China in manufacturing of lithium batteries — 10% of global production — he said in the 2020 testimony, but the sector is still on the move in the United States.

“Production, of course, would really be years out,” Ussery said. “But I think that’s the game. The world is open for sale. China and Russia and others are out buying. I’m not sure we’re doing the same thing.”

As for Solvay, lithium shortage or not, Finelli said that stepping up the domestic production of batteries is a national security issue. At the moment, the company makes battery components in France and China but has prepared an American facility to launch a component line for the U.S. market along with future investments.

“The key thing we’re making sure legislators know about is that it’s nice to have a battery plant in the United States — that’s fantastic — but if you don’t have the raw materials on U.S. soil, you’re still going to be relying on the Chinese or someone else to bring the key raw materials in,” he said. “That’s why you need to have the whole supply chain in your country as well.”

Reach Molly Hulsey at 864-720-1223.

 

And now, the students of the #universe

 

join these dots…

 

from the image below…

 

 

#Enjoy

 

Dimag ka batti jalao…

 

Sabkuch dikhta nahi hain…


Most of the scientific innovation goes hand in hand with the lessons learnt from history. And history is always about the past.Maybe the reason behind latest breakthrough in the battery industry by Tesla
(watch here) is the USA troops withdrawal from Afghanistan and the insecurity regarding availability of Lithium.

And now - guys - fasten your seat-belt - for the ultimate anti-climax

Start thinking about why we started the EV option in the first place - for global warming - ha ha ha

Aab maja luto - the way i thought about the whole issue while sipping the hot morning tea on the roof top of my ordinary home in Bharat


The simple solution from a simple guy to the big complicated problem - Global Warming - unlike the Global Leaders...





When the #globalleaders are so worried about high-funda stuff like #pollutoin #globalwarming


that they travel a very long distance on their #privatejets


and meet with each other


called #summit


my little brain has thought about this simple theory...


lena hai lo... nahin to bhi chalega... (#hindi)


meaning...


if you want to take it, very good... otherwise ... no problem...


with the proliferation of #internet


when from "The world is Flat"


we have come to this reality that


"The Flat is the World"


which essentially means that we really don't have to travel long distances to attend all such


#summit


for


#timepass


and


#drama


when physical movement has really become #outdated


let's bring back the old and #timetested


#bicycle


#horsecart


#bullockcart this one is exclusively for people of #bharat because we don't have many horses


#skating


#tricycle


#rickshaw


people are encouraged to add whatever they think will do


but without producing much


#gases


which might create


#gaslighting


no more #gases for the #universe

Tuesday, June 28, 2022

The first leadership lesson - get an uncluttered mind about the purpose before you start anything - then just stick to it no matter what comes...


The Guru in me is today happily claiming his bragging rights...

Possibilities are infinite...



I always say it's important to get an #unclutterd mind for a leader.

when I started training my 6 years-old son #ridit in CS, I had to convince many people of the need for this.

I expected the school would promote such a unique idea.

alas!  

So I had to pull him out of the formal schooling system because I know what I am doing and how I have chalked out the plan to make a fantastic scientist out of a young boy of #bharat 

with great success, I started posting his work on #linkedin and everywhere - but u would be surprised how people initially doubted him and mocked him.

#ridit became absolutely friendless in school as he never had a friend who could match his vibe or outlook. instead, what he got was just negativity everywhere.

so u see, it's so difficult to establish #wisdom in the #people of #bharat from being inside #bharat. 

that's why it's said if one wishes to conquer #bharat, he/she will have to start influencing people outside #bharat. 

#vivekananda, #rabindranath all are real-life victims of this deplorable blindness of the people of #bharat 

here is #ridit - the new face of #vishwagurubharath -  showcasing his  latest work on #fluidsimulation



So today, me, the scientist #dad rejoicing to watch his son - currently 11 years old  - making a strong foothold as a computer scientist 

this is the second project in this series in which #ridit is playing with fluid simulation using #mantaflow this time creating #tornado with #fire.



I have purposefully chosen Natural Process Simulation as the next subject for #ridit to delve into. being the #guru of #ridit - I have specifically chosen #FluidSimulation from the vast field of Natural process Simulation as #ridit already knows how to do it using #blender.

This is the third simulation of a tornado that #ridit has just completed. Please have a look at it. One of the youngest scientists from #bharat. Let's celebrate this.




And this is the fourth one.




However, as #ridit is trying to play a bigger role, not just as a user of the software, but as the person who would participate in the development of such critical stuff for mankind, hence the development environment for deep study of this software is also ready. very soon, that journey, in which we will witness how a young boy will transform himself from a computer engineer to a computer scientist.




My advice to parents of #universe - if u want to create an accomplished achiever out of your young kids, treat them as if they have already become.

This is the methodology I have always used to uplift many others in my life. 

Just make them believe - that they are going to change the world - 
and see they will surely.

#Enjoy the arrival of a new face from the #vishwagurubharath  - currently an 11-years-old boy - #ridit

And here is #ridit - matching his energy level to the 

#roaringlion 

#universe - we are here to reclaim our true level in the

#newworldorder




A good decision I have taken on behalf of #ridit - I gave him only #linux.

my earnest request to the Govt Of India 

please kick out #windows and welcome #linux -

and let the future scientists of #bharat #enjoy the #freedom necessary for a scientist

believe me, #linux as a development machine is even much better than a Mac machine 

So,  let us kick out 

#Windows 

permanently from 

#bharat

and

let us all welcome 

#linux  

And let me add another piece of mindful statement

The Govt of India may learn the way China had subcontracted the whole deployment of Linux to Ubuntu, similarly, instead of investing more money to #Boss ( a project which has been running - maybe more than 10 years) and straightway contact Ubuntu - and get it done.

Saturday, May 28, 2022

Command Routing Using Chain Of Responsibility Design Pattern...



The Song in English Script:


Jodi tor daak shune keu na aashe tobe ekla cholo re.
Ekla cholo ekla cholo ekla cholo ekla cholo re.
Jodi keu kotha na koy ore ore o obhaga
Jodi shobai thaake mukh phiraye shobai kore bhoy
Tobe poran khuleyO tui mukh phutey tor moner kotha ekla bolo re.
Jodi shobai phirey jay ore ore o obhaga
Jodi gohon pothe jabar kaale keu phirey na chaai
Tobe pother kaantaO tui roktomakha chorontole ekla dolo re.
Jodi aalo na dhore orey orey o obhaga
Jodi jhor badole aandhar raate duyar dey ghore
Tobe bojranole Aapon buker paanjor jwalie niye ekla jolo re.

The Song in English Translation:


If they pay no heed to your call walk on your own.
Walk alone, walk alone, walk alone, walk all alone.
If none speaks, o wretched one,
If all turn their face away and cower in silence—
Then open out your heart
dear one, speak out your mind, voice alone.
If everyone spurns, o wretched one
If all leave you in the lurch in the wilderness
Then trample the trail of thorns
With your blood-stained feet alone, on your own.
If no one holds up a light, o wretched one
And bolts the doors on a dark, stormy night
Then in the lightning fire of pain
Kindle your own heart and keep it burning bright alone.


It takes time to gain expertise…

Today, with just a Google search, we can get a hell of a lot of information about a detailed analysis of any specific software framework. But when I started in the mid ‘90s with MFC/Visual C++, it was an entirely different ball game. So, i struggled, i banged my head, i travelled a long distance in the hot summer, i did everything a normal human being can do to decipher the internal code structure of MFC/VC++. I remember, i started studying the Gang of Four Design Pattern book around 2001 - 2002. And then the engineer in me was again born. The analytical mind to dig into a framework code to understand different aspects of Object oriented Design Principle was again honed.

And hence, when I googled today about the use of Chain Of Responsibility Design pattern in MFC’s Command Routing architecture, I got a hell of a lot of big documents describing all the applicable Gang of Four Design Pattern in just a flash.

And then I remember, in Bangalore/Trivandrum, my everyday night outs in front of an ordinary PC to understand by taking notes and creating an image of the exact flow in the mind to get an uncluttered mind about this very Design pattern in the MFC command routing architecture.

Universe, today let me tell you about the road an inquisitive mind has to travel to decipher a specific maze out of his own. I will tell you my confusion about mapping the design used in the MFC command routing when i started to look at it from a designer’s perspective.

The first thing that, as the name suggests, it has to do something with the command pattern. And, as the basic principle of command pattern is to execute a specific chunk of code, whenever the command is asked to be executed, and obviously this is what is happening here. Hence, i started looking at the whole flow with just keeping Command Pattern in mind. However, somewhat was missing. I spent two three days about that missing part. it was not exactly command pattern. Then what it could have been.

Then suddenly, one early morning,in Trivundrum, i jumped out of bed and looked at the rough sketch of the flow and then it clicked probably, the commands are passed using the Chain Of Responsibilty design pattern, because its absolutely fixed in nature, has to happen only on the path of the chain - no exception.

And voila!!!

After that, it was just a cake walk.

Everything just fell in line.

The difficult code started behaving like bhiggi billi.

No camouflage.

Clear cut.

The intention of the designer became absolutely clear.

And, the scientist in me became happy just to figure it out.

Let’s not forget that a scientist never thinks of just making money to remain happy and contended and motivated.

Otherwise, the ancient sages of #bharat would not have become sages just for acquiring knowledge and wisdom.

For certain people, the calling is higher.

We had Swami Vivekananda, Netaji Subhash Chandra Bose, Rishi Aurobindo and many more who were purposefully erased from the minds of the young generation of #bharat to push a certain political agenda of making us impotent and feeble so that we forget WhoWeAre as a nation.

I remember, after few months, before i left Trivandrum, there was a telephonic interview from Chennai where i told about this basic architecture of MFC command routing and the interviewer was just flattened.

So, my suggestion to all of the learners of Object oriented principles, don’t study Command Design Pattern and Chain of Responsibility as two separate entities.

Rather, think of them as the right jugalbandi where the commands from the Command Pattern will be passed along the chain of the Chain of Responsibility Design pattern, and MFC command routing architecture is a practical framework where this basic principle has been applied.

And, hence, when my currently 11-year-old son #ridit completed his study about the command pattern, I refactored his code to fit into the Chain of Responsibility design pattern, which will be his next area of study.

See, the dots are so nicely connected backwards.

I think I submitted my first article on the use of a specific Design pattern in MFC (i can’t remember which one I did) at CodeGuru with a UML diagram and everything possible to explain it to a layman, and my joy was unbounded when, after a few days, it was published. And then the confidence was built, and the journey to contribute to the learning community started.

So you know, it's hard work, determination, sweat and blood, night outs in front of the computer, and sheer resilience that today I can work as an independent #guru for my currently 11-year-old son #ridit.

So, a few days back, when Ridit completed the Command Design Pattern, and he finished the learning process by offering an online training explaining the same design pattern while programming in C++ in camera, I decided to train him on Chain Of Responsibility as the right application of the Command Pattern, and this idea I took from my initial days of study of the MFC framework.

So, you see, the dots ultimately get connected backwards…

Here's my efforts in which a kind of application where a command will be routed along with the path of a predetermined chain of the Chain Of Responsibility design pattern has been depicted.

Enjoy.

My application, written in C++ showcasing use of the Chain of Responsibility to route a Command

I refactored my son's code of Command Pattern, and here is the result…

/*
 * Level.h
 *
 *  Created on: May 28, 2022
 *      Author: som
 */

#ifndef LEVEL_H_
#define LEVEL_H_

enum class Level {level1, level2, level3};

enum class CommandType {Tea, Coffee};


#endif /* LEVEL_H_ */
#ifndef COMMAND_H_
#define COMMAND_H_

#include <iostream>
#include "Receiver.h"
#include "Level.h"


class Receiver;

using namespace std;

class Task {
protected:
	CommandType type;
	string description;
	Level level;
	Receiver* receiver;

protected:


public:
	Task(CommandType inType, string inDescription, Level inLevel, Receiver* inReceiver);
	virtual ~Task();

	virtual void execute();

	CommandType getCommandType();


	Level getLevel();


	string getDescription();

	Receiver* getReceiver();

};



#endif /* COMMAND_H_ */

#include "Command.h"
#include "Level.h"

Task::Task(CommandType inType, string inDescription, Level inLevel, Receiver* inReceiver){
	type = inType;
	description = inDescription;
	level = inLevel;
	receiver = inReceiver;

}

Task::~Task(){

}

CommandType Task::getCommandType(){
	return type;
}

Level Task::getLevel(){
	return level;
}

string Task::getDescription(){
	return description;
}

Receiver* Task::getReceiver(){
	return receiver;
}

void Task::execute(){
	receiver->handleCommand(this);
}
#ifndef RECIEVER_H_
#define RECIEVER_H_

#include <iostream>

using namespace std;

class Task;
class Receiver {

protected:
	Receiver* successor; //next level
public:

	Receiver();

	Receiver(Receiver* inSuccessor);

	virtual ~Receiver();

	virtual bool handleCommmandImpl(Task* command) = 0;


	void handleCommand(Task* command);

	Receiver* getSuccessor();

};

#endif /* RECIEVER_H_ */

#include "Receiver.h"
#include "Command.h"

Receiver::Receiver(){

	successor = NULL;
}

Receiver::Receiver(Receiver* inSuccessor){

	successor = inSuccessor;

}

Receiver::~Receiver(){

}

void Receiver::handleCommand(Task* command){

	bool handledAtThisNode = this->handleCommmandImpl(command);

	if((successor != NULL) && !handledAtThisNode) {
		successor->handleCommand(command);
	}

}

Receiver* Receiver::getSuccessor(){
	return successor;
}

#ifndef RECEIVERLEVEL1_H_
#define RECEIVERLEVEL1_H_

#include "Receiver.h"

class ReceiverLevel1 : public Receiver{


public:
	ReceiverLevel1(Receiver* inSuccessor);


	virtual ~ReceiverLevel1();

	//override
	bool handleCommmandImpl(Task* command);
};

#endif /* RECEIVERLEVEL1_H_ */

#include "ReceiverLevel1.h"

#include "Command.h"

ReceiverLevel1::ReceiverLevel1(Receiver* inSuccessor){

	Receiver::successor = inSuccessor;

}

ReceiverLevel1::~ReceiverLevel1(){


}
bool ReceiverLevel1::handleCommmandImpl(Task* command){

	if(command->getCommandType() == CommandType::Tea){
		if(command->getLevel() == Level::level1){
			cout<<"TeaCommand is handled at level1"<<endl;
			return true;
		}

		else {
			return false;
		}

	}

	if(command->getCommandType() == CommandType::Coffee){
		if(command->getLevel() == Level::level1){
			cout<<"CoffeeCommand is handled at level1"<<endl;
			return true;
		}
		else {
			return false;
		}
	}

	return false;

}
#ifndef RECEIVERLEVEL2_H_
#define RECEIVERLEVEL2_H_

#include "Receiver.h"

class ReceiverLevel2 :public Receiver{


public:

	ReceiverLevel2(Receiver* inSuccessor);
	virtual ~ReceiverLevel2();

	//override
	bool handleCommmandImpl(Task* command);
};

#endif /* RECEIVERLEVEL2_H_ */

#include "ReceiverLevel2.h"
#include "Command.h"

ReceiverLevel2::ReceiverLevel2(Receiver* inSuccessor){
	// TODO Auto-generated constructor stub
	successor = inSuccessor;

}

ReceiverLevel2::~ReceiverLevel2() {
	// TODO Auto-generated destructor stub
}

bool ReceiverLevel2::handleCommmandImpl(Task* command){

	if(command->getCommandType() == CommandType::Tea){
		if(command->getLevel() == Level::level2){
			cout<<"TeaCommand is handled at level2"<<endl;
			return true;
		}

		else {
			return false;
		}

	}

	if(command->getCommandType() == CommandType::Coffee){
		if(command->getLevel() == Level::level2){
			cout<<"CoffeeCommand is handled at level2"<<endl;
			return true;
		}
		else {
			return false;
		}
	}

	return false;
}
#ifndef RECEIVERLEVEL3_H_
#define RECEIVERLEVEL3_H_


#include "Receiver.h"

class ReceiverLevel3 :public Receiver{

public:

	ReceiverLevel3(Receiver* inSuccessor);
	virtual ~ReceiverLevel3();

	//override
	bool handleCommmandImpl(Task* command);
};

#endif /* RECEIVERLEVEL3_H_ */

#include "ReceiverLevel3.h"
#include "Command.h"

ReceiverLevel3::ReceiverLevel3(Receiver* inSuccessor){
	// TODO Auto-generated constructor stub
	successor = inSuccessor;

}

ReceiverLevel3::~ReceiverLevel3() {
	// TODO Auto-generated destructor stub
}

bool ReceiverLevel3::handleCommmandImpl(Task* command){

	if(command->getCommandType() == CommandType::Tea){
		if(command->getLevel() == Level::level3){
			cout<<"TeaCommand is handled at level3"<<endl;
			return true;
		}

		else {
			return false;
		}

	}

	if(command->getCommandType() == CommandType::Coffee){
		if(command->getLevel() == Level::level3){
			cout<<"CoffeeCommand is handled at level3"<<endl;
			return true;
		}
		else {
			return false;
		}
	}

	return false;
}
/*
 * Main.cpp
 *
 *  Created on: May 28, 2022
 *      Author: som
 */

#include <iostream>
#include "Receiver.h"
#include "ReceiverLevel1.h"
#include "ReceiverLevel2.h"
#include "ReceiverLevel3.h"
#include "Command.h"

class Task;

void invokeCommand(Task command){
	command.execute();
}

int main(){

	Receiver* receiver3 = new ReceiverLevel3(NULL);
	Receiver* receiver2 = new ReceiverLevel2(receiver3);
	Receiver* firstReceiver = new ReceiverLevel1(receiver2);
	Task teaCommand(CommandType::Tea, "tea command",Level::level2, firstReceiver);

	Task coffeCommand(CommandType::Coffee, "Coffee command",Level::level3, firstReceiver);

	invokeCommand(teaCommand);
	invokeCommand(coffeCommand);
}