Search This Blog

Monday, November 13, 2023

Non-small-cell lung cancer

From Wikipedia, the free encyclopedia
Non-small-cell lung cancer
Other namesNon-small-cell lung carcinoma
Micrograph of a squamous carcinoma, a type of non-small-cell lung carcinoma, FNA specimen, Pap stain.
SpecialtyOncology 

Non-small-cell lung cancer (NSCLC), or non-small-cell lung carcinoma, is any type of epithelial lung cancer other than small-cell lung cancer (SCLC). NSCLC accounts for about 85% of all lung cancers. As a class, NSCLCs are relatively insensitive to chemotherapy, compared to small-cell carcinoma. When possible, they are primarily treated by surgical resection with curative intent, although chemotherapy has been used increasingly both preoperatively (neoadjuvant chemotherapy) and postoperatively (adjuvant chemotherapy).

Types

Pie chart showing incidences of nonsmall-cell lung cancers as compared to small-cell carcinoma shown at right, with fractions of smokers versus nonsmokers shown for each type

The most common types of NSCLC are squamous-cell carcinoma, large-cell carcinoma, and adenocarcinoma, but several other types occur less frequently. A few of the less common types are pleomorphic, carcinoid tumor, salivary gland carcinoma, and unclassified carcinoma. All types can occur in unusual histologic variants and as mixed cell-type combinations. Non-squamous-cell carcinoma almost occupies the half of NSCLC. In the tissue classification, the central type contains about one-ninth.

Sometimes, the phrase "not otherwise specified" (NOS) is used generically, usually when a more specific diagnosis cannot be made. This is most often the case when a pathologist examines a small number of malignant cells or tissue in a cytology or biopsy specimen.

Lung cancer in people who have never smoked is almost universally NSCLC, with a sizeable majority being adenocarcinoma.

On relatively rare occasions, malignant lung tumors are found to contain components of both SCLC and NSCLC. In these cases, the tumors are classified as combined small-cell lung carcinoma (c-SCLC), and are (usually) treated as "pure" SCLC.

Lung adenocarcinoma

Adenocarcinoma of the lung is currently the most common type of lung cancer in "never smokers" (lifelong nonsmokers). Adenocarcinomas account for about 40% of lung cancers. Historically, adenocarcinoma was more often seen peripherally in the lungs than SCLC and squamous-cell lung cancer, both of which tended to be more often centrally located. Recent studies, though, suggest that the "ratio of centrally to peripherally occurring" lesions may be converging toward unity for both adenocarcinoma and squamous-cell carcinoma.

Squamous-cell lung carcinoma

Photograph of a squamous-cell carcinoma: The tumour is on the left, obstructing the bronchus (lung). Beyond the tumour, the bronchus is inflamed and contains mucus.

Squamous-cell carcinoma (SCC) of the lung is more common in men than in women. It is closely correlated with a history of tobacco smoking, more so than most other types of lung cancer. According to the Nurses' Health Study, the relative risk of SCC is around 5.5, both among those with a previous duration of smoking of 1 to 20 years, and those with 20 to 30 years, compared to "never smokers" (lifelong nonsmokers). The relative risk increases to about 16 with a previous smoking duration of 30 to 40 years, and roughly 22 with more than 40 years.

Large-cell lung carcinoma

Large-cell lung carcinoma (LCLC) is a heterogeneous group of undifferentiated malignant neoplasms originating from transformed epithelial cells in the lung. LCLCs have typically comprised around 10% of all NSCLC in the past, although newer diagnostic techniques seem to be reducing the incidence of diagnosis of "classic" LCLC in favor of more poorly differentiated SCCs and adenocarcinomas. LCLC is, in effect, a "diagnosis of exclusion", in that the tumor cells lack light microscopic characteristics that would classify the neoplasm as a small-cell carcinoma, squamous-cell carcinoma, adenocarcinoma, or other more specific histologic type of lung cancer. LCLC is differentiated from SCLC primarily by the larger size of the anaplastic cells, a higher cytoplasmic-to-nuclear size ratio, and a lack of "salt-and-pepper" chromatin.

Symptoms

Many of the symptoms of NSCLC can be signs of other diseases, but having chronic or overlapping symptoms may be a signal of the presence of the disease. Some symptoms are indicators of less advanced cases, while some may signal that the cancer has spread. Some of the symptoms of less advanced cancer include chronic cough, coughing up blood, hoarseness, shortness of breath, wheezing, chest pain, weight loss, and loss of appetite. A few more symptoms associated with the early progression of the disease are feeling weak, being very tired, having trouble swallowing, swelling in the face or neck, and continuous or recurring infections such as bronchitis or pneumonia. Signs of more advanced cases include bone pain, nervous-system changes (headache, weakness, dizziness, balance problems, seizures), jaundice, lumps near the surface of the body, numbness of extremities due to Pancoast syndrome, and nausea, vomiting, and constipation brought on by hypercalcemia. Some more of the symptoms that indicate further progression of the cancer include shortness of breath, superior vena cava syndrome, trouble swallowing, large amounts of mucus, weakness, fatigue, and hoarseness.

Cause

Smoking is by far the leading risk factor for lung cancer. Cigarette smoke contains more than 6,000 components, many of which lead to DNA damage (see table of tobacco-related DNA damages in Tobacco smoking).

Other causes include radon, exposure to secondhand smoke, exposure to substances such as asbestos, chromium, nickel, beryllium, soot, or tar, family history of lung cancer, and air pollution.

Genetics can also play a role as a family history of lung cancer can contribute to an increased risk of developing the disease. Furthermore, research has revealed specific chromosome regions associated with increased risks of developing lung cancer.

In general, DNA damage appears to be the primary underlying cause of cancer. Though most DNA damages are repairable, leftover unrepaired DNA damages from cigarette smoke are the likely cause of NSCLC.

DNA replication past an unrepaired damage can give rise to a mutation because of inaccurate translesion synthesis. In addition, during repair of DNA double-strand breaks, or repair of other DNA damages, incompletely cleared sites of repair can lead to epigenetic gene silencing.

DNA repair deficiency in NSCLC

Deficiencies in DNA repair underlie many forms of cancer. If DNA repair is deficient, the frequency of unrepaired DNA damages increases, and these tend to cause inaccurate translesion synthesis leading to mutation. Furthermore, increased damages can elevate incomplete repair, leading to epigenetic alterations.

Mutations in DNA repair genes occasionally occur in cancer, but deficiencies of DNA repair due to epigenetic alterations that reduce or silence DNA repair-gene expression occur much more frequently in cancer.

Epigenetic gene silencing of DNA repair genes occurs frequently in NSCLC. At least nine DNA repair genes that normally function in relatively accurate DNA repair pathways are often repressed by promoter hypermethylation in NSCLC. One DNA repair gene, FEN1, that functions in an inaccurate DNA repair pathway, is expressed at an increased level due to hypo-, rather than hyper-, methylation of its promoter region (deficiency of promoter methylation) in NSCLC.

Epigenetic promoter methylation in DNA repair genes in NSCLC
Gene Frequency of hyper- (or hypo-) methylation DNA repair pathway
NEIL1 42% base excision repair
WRN 38% homologous recombinational repair, nonhomologous end joining, base excision repair
MGMT 13% - 64% direct reversal
ATM 47% homologous recombinational repair
MLH1 48% - 73% mismatch repair
MSH2 42% - 63% mismatch repair
BRCA2 42% homologous recombinational repair
BRCA1 30% homologous recombinational repair
XRCC5 (Ku80) 20% nonhomologous end joining
FEN1 100% hypomethylated (increased expression) microhomology-mediated end joining

The frequent deficiencies in accurate DNA repair, and the increase in inaccurate repair, likely cause the high level of mutation in lung cancer cells of more than 100,000 mutations per genome (see Whole genome sequencing).

Staging

Staging is a formal procedure to determine how developed the cancer is, which determines treatment options.

The American Joint Committee on Cancer and the International Union Against Cancer recommend TNM staging, using a uniform scheme for NSCLC, SCLC, and bronchopulmonary carcinoid tumors. With TNM staging, the cancer is classified based on the size of the tumor and spread to lymph nodes and other organs. As the tumor grows in size and the areas affected become larger, the staging of the cancer becomes more advanced as well.

Several components of NSCLC staging then influence physicians' treatment strategies. The lung tumor itself is typically assessed both radiographically for overall size and by a pathologist under the microscope to identify specific genetic markers or to see if invasion into important structures within the chest (e.g., bronchus or pleural cavity) has occurred. Next, the patient's nearby lymph nodes within the chest cavity, known as the mediastinum, are checked for disease involvement. Finally, the patient is evaluated for more distant sites of metastatic disease, most typically with brain imaging and or scans of the bones.

Five-year survival rates

The survival rates for stages I through IV decrease significantly due to the advancement of the disease. For stage I, the five-year survival rate is 47%, stage II is 30%, stage III is 10%, and stage IV is 1%.

Treatment

More than one kind of treatment is often used, depending on the stage of the cancer, the individual's overall health, age, response to chemotherapy, and other factors such as the likely side effects of the treatment. After full staging, the NSCLC patient can typically be classified in one of three different categories: patients with early, nonmetastatic disease (stages I and II, and select type III tumors), patients with locally advanced disease confined to the thoracic cavity (e.g., large tumors, tumors involving critical chest structures, or patients with positive mediastinal lymph nodes), or patients with distant metastasis outside of the thoracic cavity.

Early/nonmetastatic NSCLC

NSCLCs are usually not very sensitive to chemotherapy and/or radiation, so surgery (lung resection to remove the tumor) remains the treatment of choice if patients are diagnosed at an early stage.

If the persons have a small, but inoperable tumor, they may undergo highly targeted, high-intensity radiation therapy. New methods of giving radiation treatment allow doctors to be more accurate in treating lung cancers. This means less radiation affects nearby healthy tissues. New methods include Cyberknife and stereotactic body radiation therapy. Certain people who are deemed to be higher risk may also receive adjuvant (ancillary) chemotherapy after initial surgery or radiation therapy. A number of possible chemotherapy agents can be selected, but most involve the platinum-based chemotherapy drug called cisplatin.

Other treatments include percutaneous ablation and chemoembolization. The most widely used ablation techniques for lung cancer are radiofrequency ablation (RFA), cryoablation, and microwave ablation. Ablation may be an option for patients whose tumors are near the outer edge of the lungs. Nodules less than 1 cm from the trachea, main bronchi, oesophagus, and central vessels should be excluded from RFA given high risk of complications and frequent incomplete ablation. Additionally, lesions greater than 5 cm should be excluded and lesions 3 to 5 cm should be considered with caution given high risk of recurrence. As a minimally invasive procedure, it can be a safer alternative for patients who are poor candidates for surgery due to comorbidities or limited lung function. A study comparing thermal ablation to sublobar resection as treatment for early stage NSCLC in older people found no difference in overall survival of the patients. It is possible that RFA followed by radiation therapy has a survival benefit due to synergism of the two mechanisms of cell destruction.

Advanced/metastatic NSCLC

The treatment approach for people who have advanced NSCLC is first aimed at relieving pain and distress (palliative), but a wide variety of chemotherapy options exists. These agents include both traditional chemotherapies, such as cisplatin, which indiscriminately target all rapidly dividing cells, and newer targeted agents, which are more tailored to specific genetic aberrations found within a person's tumor. When choosing an appropriate chemotherapy approach, the toxicity profile (side effects of the drug) should be taken into account and balanced with the person's comorbidities (other conditions or side effects that the person is experiencing). Carboplatin is a chemotherapy agent that has a similar effect on a person's survival when compared to cisplatin, and has a different toxicity profile from cisplatin. Carboplatin may be associated with a higher risk of thrombocytopenia. Cisplatin may cause more nausea or vomiting when compared to carboplatin treatment. PD‐L1 inhibitors are more effective and lead to longer survival with fewer side effects compared to platinum-based chemotherapy.

At present, two genetic markers are routinely profiled in NSCLC tumors to guide further treatment decision-making - mutations within epidermal growth factor (EGFR) and anaplastic lymphoma kinase. Also, a number of additional genetic markers are known to be mutated within NSCLC and may impact treatment in the future, including BRAF, HER2/neu, and KRAS. For advanced NSCLC, a combined chemotherapy treatment approach that includes cetuximab, an antibody that targets the EGFR signalling pathway, is more effective at improving a person's overall survival when compared to standard chemotherapy alone.

Thermal ablations, i.e. RFA, cryoablation, and microwave ablation, are appropriate for palliative treatment of tumor-related symptoms or recurrences within treatment fields. People with severe pulmonary fibrosis and severe emphysema with a life expectancy less than a year should be considered poor candidates for this treatment.

EGFR mutations

Roughly 10–35% of people who have NSCLC will have drug-sensitizing mutations of the EGFR. The distribution of these mutations has been found to be race-dependent, with one study estimating that 10% of Caucasians, but 50% of Asians, will be found to have such tumor markers. A number of different EGFR mutations have been discovered, but certain aberrations result in hyperactive forms of the protein. People with these mutations are more likely to have adenocarcinoma histology and be nonsmokers or light smokers. These people have been shown to be sensitized to certain medications that block the EGFR protein known as tyrosine kinase inhibitors specifically, erlotinib, gefitinib, afatinib, or osimertinib. Reliable identification of mutations in lung cancer needs careful consideration due to the variable sensitivity of diagnostic techniques.

ALK gene rearrangements

Up to 7% of NSCLC patients have EML4-ALK translocations or mutations in the ROS1 gene; these patients may benefit from ALK inhibitors, which are now approved for this subset of patients. Crizotinib, which gained FDA approval in August 2011, is an inhibitor of several kinases, specifically ALK, ROS1, and MET. Crizotinib has been shown in clinical studies to have response rates around 60% if patients are shown to have ALK-positive disease. Several studies have also shown that ALK mutations and EGFR activating mutations are typically mutually exclusive. Thus, patients who fail crizotinib are not recommended to be switched to an EGFR-targeted drug such as erlotinib.

Other treatment options

Micrograph showing a PD-L1-positive NSCLC, PD-L1 immunostain

NSCLC patients with advanced disease who are not found to have either EGFR or ALK mutations may receive bevacizumab, which is a monoclonal antibody medication targeted against the vascular endothelial growth factor (VEGF). This is based on an Eastern Cooperative Oncology Group study that found that adding bevacizumab to carboplatin and paclitaxel chemotherapy for certain patients with recurrent or advanced NSCLC (stage IIIB or IV) may increase both overall survival and progression-free survival.

https://doi.org/10.3390/ph13110373
The main treatment arms of phase 3 clinical trials providing immunotherapy in the first line for patients with non-small cell lung cancer.
Non-small cell lung cancer (NSCLC) cells expressing programmed death-ligand 1 (PD-L1) could interact with programmed death receptor 1 (PD-1) expressed on the surface of T cells, and result in decreased tumor cell kill by the immune system. Atezolizumab is an anti PD-L1 monoclonal antibody. Nivolumab and Pembrolizumab are anti PD-1 monoclonal antibodies. Ipilimumab is a monoclonal antibody that targets Cytotoxic T-lymphocyte-associated protein 4 (CTLA-4) on the surface of T cells. Bevacizumab is a monoclonal antibody that targets Vascular Endothelial Growth Factor (VEGF) in the circulation and functions as an angiogenesis inhibitor.

NSCLC cells expressing programmed death-ligand 1 (PD-L1) could interact with programmed death receptor 1 (PD-1) expressed on the surface of T cells, and result in decreased tumor cell kill by the immune system. Atezolizumab is an anti PD-L1 monoclonal antibody. Nivolumab and Pembrolizumab are anti PD-1 monoclonal antibodies. Ipilimumab is a monoclonal antibody that targets Cytotoxic T-lymphocyte-associated protein 4 (CTLA-4) on the surface of T cells. Bevacizumab is a monoclonal antibody that targets Vascular Endothelial Growth Factor (VEGF) in the circulation and functions as an angiogenesis inhibitor. Multiple phase 3 clinical trials utilizing immunotherapy in the first line for treatment of NSCLC were published, including Pembrolizumab in KEYNOTE-024, KEYNOTE-042, KEYNOTE-189 and KEYNOTE-407; Nivolumab and Ipilimumab in CHECKMATE-227 and CHECKMATE 9LA; and Atezolizumab in IMpower110, IMpower130 and IMpower150.

In 2015, the US Food and Drug Administration (FDA) approved the anti-PD-1 agent nivolumab for advanced or metastatic SCC.

In 2015, FDA also approved the anti-EGFR drug necitumumab for metastatic SCC.

2 October 2015, the FDA approved pembrolizumab for the treatment of metastatic NSCLC in patients whose tumors express PD-L1 and who have failed treatment with other chemotherapeutic agents.[58]

October 2016, pembrolizumab became the first immunotherapy to be used first line in the treatment of NSCLC if the cancer overexpresses PDL1 and the cancer has no mutations in EGFR or in ALK; if chemotherapy has already been administered, then pembrolizumab can be used as a second-line treatment, but if the cancer has EGFR or ALK mutations, agents targeting those mutations should be used first. Assessment of PDL1 must be conducted with a validated and approved companion diagnostic.

https://doi.org/10.3390/ph13110373
Overall survival in non-small cell lung cancer patients treated with protocols incorporating immunotherapy in the first line for advanced or metastatic disease. Nasser NJ, Gorenberg M, Agbarya A. Pharmaceuticals2020, 13(11), 373; https://doi.org/10.3390/ph13110373

The prognosis of patients with non-small-cell lung cancer improved significantly with the introduction of immunotherapy. People with tumor PDL-1 expressed over half or more of the tumor cells achieved a median overall survival of 30 months with pembrolizumab.

Mobocertinib (Exkivity) was approved for medical use in the United States in September 2021, and it is indicated for adults with locally advanced or metastatic non-small cell lung cancer (NSCLC) with epidermal growth factor receptor (EGFR) exon 20 insertion mutations, as detected by an FDA-approved test, whose disease has progressed on or after platinum-based chemotherapy.

Software bloat

From Wikipedia, the free encyclopedia

Software bloat is a process whereby successive versions of a computer program become perceptibly slower, use more memory, disk space or processing power, or have higher hardware requirements than the previous version, while making only dubious user-perceptible improvements or suffering from feature creep. The term is not applied consistently; it is often used as a pejorative by end users (bloatware) to describe undesired user interface changes even if those changes had little or no effect on the hardware requirements. In long-lived software, perceived bloat can occur from the software servicing a large, diverse marketplace with many differing requirements. Most end users will feel they only need some limited subset of the available functions, and will regard the others as unnecessary bloat, even if end users with different requirements require those functions.

Actual (measurable) bloat can occur due to de-emphasising algorithmic efficiency in favour of other concerns like developer productivity, or possibly through the introduction of new layers of abstraction like a virtual machine or other scripting engine for the purposes of convenience when developer constraints are reduced. The perception of improved developer productivity, in the case of practising development within virtual machine environments, comes from the developers no longer taking resource constraints and usage into consideration during design and development; this allows the product to be completed faster but it results in increases to the end user's hardware requirements to compensate.

The term "bloatware" is also used to describe unwanted pre-installed software or bundled programs.

Types of bloat

Program bloat

In computer programming, code bloat refers to the presence of program code (source code or machine code) that is perceived as unnecessarily long, slow, or otherwise wasteful of resources.

Causes

Software inefficiency

Software developers involved in the industry during the 1970s had severe limitations on disk space and memory. Every byte and clock cycle was taken into account, and much work went into fitting the programs into available resources. Achieving this efficiency was one of the highest values of computer programmers, and the best programs were often called "elegant", a term used by mathematicians to describe a proof which is tidy, parsimonious and powerful.

By the 21st century, the situation had reversed. Resources were perceived as cheap, and rapidity of coding and headline features for marketing seen as priorities. In part, this is because technological advances have since increased processing capacity and storage density by orders of magnitude, while reducing the relative costs by similar orders of magnitude (see Moore's law). Additionally, the spread of computers through all levels of business and home life has produced a software industry many times larger than it was in the 1970s. Programs are now usually churned out by teams, directed by committees in software development studios (also known as software houses or software factories) where each programmer works on only a part of the whole, on one or more subroutines.

Finally, software development tools and approaches often result in changes throughout a program to accommodate each feature, leading to a large-scale inclusion of code which affects the main operation of the software, and is required in order to support functions that themselves may be only rarely used. In particular, the advances in resources available have led to tools which allow easier development of code, again with less priority given to end efficiency.

Another cause of bloat is independently competing standards and products, which can create a demand for integration. There are now more operating systems, browsers, protocols, and storage formats than there were before, causing bloat in programs due to interoperability issues. For example, a program that once could only save in text format is now demanded to save in HTML, XML, XLS, CSV, PDF, DOC, and other formats.

Niklaus Wirth has summed up the situation in Wirth's law, which states that software speed is decreasing more quickly than hardware speed is increasing.

In his 2001 essay Strategy Letter IV: Bloatware and the 80/20 Myth, Joel Spolsky argues that while 80% of the users only use 20% of the features (a variant on the Pareto principle), each one uses different features. Thus, "lite" software editions turn out to be useless for most, as they miss the one or two special features that are present in the "bloated" version. Spolsky sums the article with a quote by Jamie Zawinski referring to the Mozilla Application Suite (which later became SeaMonkey):

"Convenient though it would be if it were true, Mozilla is not big because it's full of useless crap. Mozilla is big because your needs are big. Your needs are big because the Internet is big. There are lots of small, lean web browsers out there that, incidentally, do almost nothing useful. [...] But being a shining jewel of perfection was not a goal when we wrote Mozilla."

Software bloat may also be a symptom of the second-system effect, described by Fred Brooks in The Mythical Man-Month.

Bloatware

The term "bloatware" may be applied to software that has become bloated through inefficiency or accretion of features as outlined above. The term also commonly refers to software preinstalled on a device, usually by the hardware manufacturer, that is mostly unwanted by the purchaser.

The term may also be applied to the accumulation of unwanted and unused software elements that remain after partial and incomplete uninstallation. These elements may include whole programs, libraries, associated configuration information, or other data. Performance may deteriorate overall as a result of such remnants, as the unwanted software or software components can occupy memory, waste processing time, add disk I/O, consume storage and cause delays at system startup and shutdown. In the worst cases, the leftover software may interfere with the correct operation of wanted software. Bloatware can be easily removed if the user has root access on their device, though the rooting process has its own advantages and disadvantages, such as voiding the manufacturer's warranty, and that certain software refuses to run on rooted devices.

Examples

Comparison of Microsoft Windows minimum hardware requirements (for x86 versions)
Windows version Processor Memory Hard disk
Windows 95 25 MHz 4 MB ~50 MB
Windows 98 66 MHz 16 MB ~200 MB
Windows 2000 133 MHz 32 MB 650 MB
Windows XP (2001) 233 MHz 64 MB 1.5 GB
Windows Vista (2007) 800 MHz 512 MB 15 GB
Windows 7 (2009) 1 GHz 1 GB 16 GB
Windows 8 (2012) 1 GHz 1 GB 16 GB
Windows 10 (2015) 1 GHz 1 GB 16 GB
Windows 11 (2021) 1 GHz

64-bit Dual-Core

4 GB 64 GB

Apple's iTunes has been accused of being bloated by efforts to turn it from a simple media player to an e-commerce and advertising platform, with former PC World editor Ed Bott accusing the company of hypocrisy in its advertising attacks on Windows for similar practices. In 2019, Apple announced the impending closure of the program, a move described by a commentator from The Guardian as being "long overdue", stating that the program had "become baroquely bloated, a striking anomaly for a company that prides itself on elegant and functional design."

Microsoft Windows has also been criticized as being bloated – with reference to Windows Vista and discussing the new, greatly slimmed down Windows 7 core components, Microsoft engineer Eric Traut commented that "This is the core of Windows 7. This is a collection of components that we've taken out. A lot of people think of Windows as this really large, bloated operating system, and that may be a fair characterization, I have to admit. It is large. It contains a lot of stuff in it. But at its core, the kernel and the components that make up the very core of the operating system actually is pretty streamlined." Ed Bott also expressed skepticism, noting that nearly every operating system that Microsoft has ever sold has been criticized as 'bloated' on first release, even those now regarded as the exact opposite, such as MS-DOS. Quoting Paul Thurrott, Bott agreed that the bloat stems from numerous enterprise-level features included in the operating system that were largely irrelevant to the average home user.

CD- and DVD-burning applications such as Nero Burning ROM have become criticized for being bloated. Superfluous features not specifically tailored to the end user are sometimes installed by default through express setups.

A number of technology blogs have also covered the issue of increased bloatware on cell phones. However, they refer to a different issue, specifically that of wireless carriers loading phones with software that, in many cases, cannot be easily, if at all, deleted. This has been most frequently cited with respect to Android devices, although this phenomenon exists on phones running many other operating systems.

Some of the most popular current messaging apps, which were previously only focused on instant messaging, have been criticized for being bloated due to feature creep. WeChat added additional features such as games, subscription services, WeChat Pay e-wallet, a news aggregator, e-commerce hub, e-government feature, cinema booking system, restaurant finder and ridesharing company, which has increased the size of the app from 2 MB in 2011 to 58 MB in 2018. Facebook Messenger, which has been separated from the Facebook app, is similarly criticized for adding additional features such as games, bots and features which copied from Snapchat such as Messenger Day (Stories), face filters, a camera with the ability to edit photos, doodle draw and added emojis and stickers. In January 2018, the head of Facebook Messaging, David A. Marcus, admitted that the app itself is extremely bloated and promised to redesign the whole app to remove unnecessary features and streamline it. The redesigned and streamlined Facebook Messenger app was announced in October 2018, in which its features are reduced to messaging, stories, discover tab and camera.

Alternatives

Some applications, such as GIMP, and software with additional functionality from plug-ins, use extensions or add-ons which are downloaded separately from the main application. These can be created by either the software developer or by third-party developers. Plug-ins, extensions, and add-ons add extra functionality which might have otherwise been packaged in the main program.

Allowing these plug-ins, extensions, and/or add-ons reduces the space used on any one machine, because even though the application, the "plug-in interface", and all the plug-ins combined are larger than the same functionality compiled into one monolithic application, it allows each user to install only the particular add-on features they require, rather than forcing every user to install a much larger monolithic application that includes all of the available features. This results in a "stripped-down" or "out-of-the-box" application that is delivered in a compact package yet is ready for users to add any missing functionality.

Open source software may use a similar technique using preprocessor directives to include features at compile time selectively. This is easier to implement and more secure than a plugin system, but has the disadvantage that a user who wants a specific set of features must compile the program from source.

Sometimes software becomes bloated because of "creeping featurism" (Zawinski's law of software envelopment). One way to reduce that kind of bloat is described by the Unix philosophy of "writing programs that do one thing and do it well," and breaking what would be a single, complicated piece of software into numerous simpler components which can be chained together using pipes, shell scripts, or other forms of interapplication communication.

Event-driven architecture

From Wikipedia, the free encyclopedia
https://en.wikipedia.org/wiki/Event-driven_architecture

Event-driven architecture (EDA) is a software architecture paradigm concerning the production and detection of events.

Overview

An event can be defined as "a significant change in state". For example, when a consumer purchases a car, the car's state changes from "for sale" to "sold". A car dealer's system architecture may treat this state change as an event whose occurrence can be made known to other applications within the architecture. From a formal perspective, what is produced, published, propagated, detected or consumed is a (typically asynchronous) message called the event notification, and not the event itself, which is the state change that triggered the message emission. Events do not travel, they just occur. However, the term event is often used metonymically to denote the notification message itself, which may lead to some confusion. This is due to Event-driven architectures often being designed atop message-driven architectures, where such communication pattern requires one of the inputs to be text-only, the message, to differentiate how each communication should be handled.

This architectural pattern may be applied by the design and implementation of applications and systems that transmit events among loosely coupled software components and services. An event-driven system typically consists of event emitters (or agents), event consumers (or sinks), and event channels. Emitters have the responsibility to detect, gather, and transfer events. An Event Emitter does not know the consumers of the event, it does not even know if a consumer exists, and in case it exists, it does not know how the event is used or further processed. Sinks have the responsibility of applying a reaction as soon as an event is presented. The reaction might or might not be completely provided by the sink itself. For instance, the sink might just have the responsibility to filter, transform and forward the event to another component or it might provide a self-contained reaction to such an event. Event channels are conduits in which events are transmitted from event emitters to event consumers. The knowledge of the correct distribution of events is exclusively present within the event channel.[citation needed] The physical implementation of event channels can be based on traditional components such as message-oriented middleware or point-to-point communication which might require a more appropriate transactional executive framework.

Building systems around an event-driven architecture simplifies horizontal scalability in distributed computing models and makes them more resilient to failure. This is because application state can be copied across multiple parallel snapshots for high-availability. New events can be initiated anywhere, but more importantly propagate across the network of data stores updating each as they arrive. Adding extra nodes becomes trivial as well: you can simply take a copy of the application state, feed it a stream of events and run with it.

Event-driven architecture can complement service-oriented architecture (SOA) because services can be activated by triggers fired on incoming events. This paradigm is particularly useful whenever the sink does not provide any self-contained executive.

SOA 2.0 evolves the implications SOA and EDA architectures provide to a richer, more robust level by leveraging previously unknown causal relationships to form a new event pattern. This new business intelligence pattern triggers further autonomous human or automated processing that adds exponential value to the enterprise by injecting value-added information into the recognized pattern which could not have been achieved previously.

Event structure

An event can be made of two parts, the event header and the event body. The event header might include information such as event name, time stamp for the event, and type of event. The event body provides the details of the state change detected. An event body should not be confused with the pattern or the logic that may be applied in reaction to the occurrence of the event itself.

Event flow layers

An event driven architecture may be built on four logical layers, starting with the sensing of an event (i.e., a significant temporal state or fact), proceeding to the creation of its technical representation in the form of an event structure and ending with a non-empty set of reactions to that event.

Event Producer

The first logical layer is the event producer, which senses a fact and represents that fact as an event message. As an example, an event producer could be an email client, an E-commerce system, a monitoring agent or some type of physical sensor.

Converting the data collected from such a diverse set of data sources to a single standardized form of data for evaluation is a significant task in the design and implementation of this first logical layer. However, considering that an event is a strongly declarative frame, any informational operations can be easily applied, thus eliminating the need for a high level of standardization.

Event channel

This is the second logical layer. An event channel is a mechanism of propagating the information collected from an event generator to the event engine or sink. This could be a TCP/IP connection, or any type of an input file (flat, XML format, e-mail, etc.). Several event channels can be opened at the same time. Usually, because the event processing engine has to process them in near real time, the event channels will be read asynchronously. The events are stored in a queue, waiting to be processed later by the event processing engine.

Event processing engine

The event processing engine is the logical layer responsible for identifying an event, and then selecting and executing the appropriate reaction. It can also trigger a number of assertions. For example, if the event that comes into the event processing engine is a product ID low in stock, this may trigger reactions such as “Order product ID” and “Notify personnel”.

Downstream event-driven activity

This is the logical layer where the consequences of the event are shown. This can be done in many different ways and forms; e.g., an email is sent to someone and an application may display some kind of warning on the screen. Depending on the level of automation provided by the sink (event processing engine) the downstream activity might not be required.

Event processing styles

There are three general styles of event processing: simple, stream, and complex. The three styles are often used together in a mature event-driven architecture.

Simple event processing

Simple event processing concerns events that are directly related to specific, measurable changes of condition. In simple event processing, a notable event happens which initiates downstream action(s). Simple event processing is commonly used to drive the real-time flow of work, thereby reducing lag time and cost.

For example, simple events can be created by a sensor detecting changes in tire pressures or ambient temperature. The car's tire incorrect pressure will generate a simple event from the sensor that will trigger a yellow light advising the driver about the state of a tire.

Event stream processing

In event stream processing (ESP), both ordinary and notable events happen. Ordinary events (orders, RFID transmissions) are screened for notability and streamed to information subscribers. Event stream processing is commonly used to drive the real-time flow of information in and around the enterprise, which enables in-time decision making.

Complex event processing

Complex event processing (CEP) allows patterns of simple and ordinary events to be considered to infer that a complex event has occurred. Complex event processing evaluates a confluence of events and then takes action. The events (notable or ordinary) may cross event types and occur over a long period of time. The event correlation may be causal, temporal, or spatial. CEP requires the employment of sophisticated event interpreters, event pattern definition and matching, and correlation techniques. CEP is commonly used to detect and respond to business anomalies, threats, and opportunities.

Online event processing

Online event processing (OLEP) uses asynchronous distributed event logs to process complex events and manage persistent data. OLEP allows reliably composing related events of a complex scenario across heterogeneous systems. It thereby enables very flexible distribution patterns with high scalability and offers strong consistency. However, it cannot guarantee upper bounds on processing time.

Extreme loose coupling and well distributed

An event-driven architecture is extremely loosely coupled and well distributed. The great distribution of this architecture exists because an event can be almost anything and exist almost anywhere. The architecture is extremely loosely coupled because the event itself doesn't know about the consequences of its cause. e.g. If we have an alarm system that records information when the front door opens, the door itself doesn't know that the alarm system will add information when the door opens, just that the door has been opened.

Semantic Coupling and further research

Event-driven architectures have loose coupling within space, time and synchronization, providing a scalable infrastructure for information exchange and distributed workflows. However, event-architectures are tightly coupled, via event subscriptions and patterns, to the semantics of the underlying event schema and values. The high degree of semantic heterogeneity of events in large and open deployments such as smart cities and the sensor web makes it difficult to develop and maintain event-based systems. In order to address semantic coupling within event-based systems the use of approximate semantic matching of events is an active area of research.

Implementations and examples

Java Swing

The Java Swing API is based on an event-driven architecture. This works particularly well with the motivation behind Swing to provide user interface related components and functionality. The API uses a nomenclature convention (e.g. "ActionListener" and "ActionEvent") to relate and organize event concerns. A class which needs to be aware of a particular event simply implements the appropriate listener, overrides the inherited methods, and is then added to the object that fires the event. A very simple example could be:

public class FooPanel extends JPanel implements ActionListener {
    public FooPanel() {
        super();

        JButton btn = new JButton("Click Me!");
        btn.addActionListener(this);

        this.add(btn);
    }

    @Override
    public void actionPerformed(ActionEvent ae) {
        System.out.println("Button has been clicked!");
    }
}

Alternatively, another implementation choice is to add the listener to the object as an anonymous class and thus use the lambda notation (since Java 1.8). Below is an example.

public class FooPanel extends JPanel {
    public FooPanel() {
        super();

        JButton btn = new JButton("Click Me!");
        btn.addActionListener(ae -> System.out.println("Button has been clicked!"));
        this.add(btn);
    }
}

JavaScript

(() => {
  'use strict';

  class EventEmitter {
    constructor() {
      this.events = new Map();
    }

    on(event, listener) {
      if (typeof listener !== 'function') {
        throw new TypeError('The listener must be a function');
      }
      let listeners = this.events.get(event);
      if (!listeners) {
        listeners = new Set();
        this.events.set(event, listeners); 
      }
      listeners.add(listener);
      return this;
    }

    off(event, listener) {
      if (!arguments.length) {
        this.events.clear();
      } else if (arguments.length === 1) {
        this.events.delete(event);
      } else {
        const listeners = this.events.get(event);
        if (listeners) {
          listeners.delete(listener);
        }
      }
      return this;
    }

    emit(event, ...args) {
      const listeners = this.events.get(event);
      if (listeners) {
        for (let listener of listeners) {
          listener.apply(this, args);
        }
      }
      return this;
    }
  }

  this.EventEmitter = EventEmitter;
})();

Usage:

const events = new EventEmitter();
events.on('foo', () => { console.log('foo'); });
events.emit('foo'); // Prints "foo"
events.off('foo');
events.emit('foo'); // Nothing will happen

Object Pascal

Events are one of the fundamental elements of the Object Pascal language. The uni-cast model (one-to-one) is used here, i.e. the sender sends information to only one recipient. This limitation has the advantage that it does not need a special event listener. The event itself is a pointer to a method in another object. If the pointer is not empty, when an event occurs, the event handler is called. Events are commonly used in classes that support GUI. This is not the only area of application for events, however. The following code is an example of using events:

unit MyCustomClass;  

interface

uses
  Classes;
  
type
  {definition of your own event}
  TAccidentEvent = procedure(Sender: TObject; const AValue: Integer) of object;

  TMyCustomObject = class(TObject)
  private
    FData: Integer;              // an example of a simple field in a class
    FOnAccident: TAccidentEvent; // event - reference to a method in some object
    FOnChange: TNotifyEvent;     // event - reference to a method in some object 
    procedure SetData(Value: Integer); // a method that sets the value of a field in the class 
  protected
    procedure DoAccident(const AValue: Integer); virtual; // a method that generates an event based on your own definition 
    procedure DoChange; // a method that generates an event based on a definition from the VCL library 
  public
    constructor Create; virtual;   // class constructor 
    destructor Destroy; override;  // class destructor
  published
    property Data: TAccidentEvent read FData write SetData; // declaration of a property in a class
    property OnAccident: TAccidentEvent read FOnAccident write FOnAccident; // exposing the event outside the class
    property OnChange: TNotifyEvent read FOnChange write FOnChange;         // exposing the event outside the class
    procedure MultiplyBy(const AValue: Integer);  // a method that uses its own definition of the event
  end;
  
implementation

constructor TMyCustomObject.Create;
begin
  FData := 0;
end;

destructor TMyCustomObject.Destroy;
begin
  FData := 0;
  inherited Destroy;
end;

procedure TMyCustomObject.DoAccident(const AValue: Integer);
begin
  if Assigned(FOnAccident)
   then FOnAccident(Self, AValue);
end;

procedure TMyCustomObject.DoChange;
begin
  if Assigned(FOnChange)
   then FOnChange(Self);
end;

procedure TMyCustomObject.MultiplyBy(const AValue: Integer);
begin
  FData := FData * AValue;
  if FData > 1000000
   then DoAccident(FData);
end;

procedure TMyCustomObject.SetData(Value: Integer);
begin
  if FData <> Value
   then
    begin
     FData := Value;
     DoChange;
    end;
end.

The created class can be used as follows:

...
procedure TMyForm.ShowCustomInfo(Sender: TObject);
begin
  if Sender is TMyCustomObject
   then ShowMessage('Data has changed.');
end;

procedure TMyForm.PerformAcident(Sender: TObject; const AValue: Integer);
begin
  if Sender is TMyCustomObject
   then ShowMessage('The data has exceeded 1000000! New value is: ' + AValue.ToString);
end;
...
{declaring a variable that is an object of the specified class}
var
  LMyObject: TMyCustomObject; 
...
{creation of the object}
LMyObject := TMyCustomObject.Create;
...
{assigning a methods to an events}
LMyObject.OnChange := MyForm.ShowCustomInfo;
LMyObject.OnAccident := MyForm.PerformAcident;
...
{removing an object when it is no longer needed}
LMyObject.Free; 
...

Entropy (information theory)

From Wikipedia, the free encyclopedia https://en.wikipedia.org/wiki/Entropy_(information_theory) In info...