Página de pruebas

From Sinfronteras
Revision as of 22:04, 15 April 2019 by Adelo Vieira (talk | contribs)
Jump to: navigation, search

Chain of Responsibility Pattern

Chain of Responsibility is a behavioral design pattern that lets you pass requests along a chain of handlers. Upon receiving a request, each handler decides either to process the request or to pass it to the next handler in the chain.


  • Chain of responsibility pattern is used to achieve lose coupling in software design.
  • A request from a client program is passed to a chain of objects to process it.
  • Then the object in the chain will decide who will be processing the request and whether the request is required to be sent to the next object in the chain or not.

Problem

Imagine that you’re working on an online ordering system. You want to restrict access to the system so only authenticated users can create orders. Also, users who have administrative permissions must have full access to all orders.

After a bit of planning, you realized that these checks must be performed sequentially. The application can attempt to authenticate a user to the system whenever it receives a request that contains the user’s credentials. However, if those credentials aren’t correct and authentication fails, there’s no reason to proceed with any other checks.

Design pattern-Chain of responsibility1.png


During the next few months, you implemented several more of those sequential checks.

  • One of your colleagues suggested that it’s unsafe to pass raw data straight to the ordering system. So you added an extra validation step to sanitize the data in a request.
  • Later, somebody noticed that the system is vulnerable to brute force password cracking. To negate this, you promptly added a check that filters repeated failed requests coming from the same IP address.
  • Someone else suggested that you could speed up the system by returning cached results on repeated requests containing the same data. Hence, you added another check which lets the request pass through to the system only if there’s no suitable cached response.
Design pattern-Chain of responsibility1.png


Example

  • A good example Chain of Responsibility pattern is an ATM machine. The user enters the amount to be dispensed and the machine dispense amount in terms of defined currency bills such as €50, €20, €10.
  • If the user enters an amount that is not multiple of 10, it throws an error.
  • If one element in the chain is not able to process it fully, it sends the request to the next processor in chain to process the remaining request.
  • If the processor is not able to process anything, it just forwards the same request to the next chain.


Introduction for the project

In recent years, with the growing of the Web 2.0, it is really easy for anyone to publish information on the Web without any verification of its authenticity. This fact has driven a radical growth of online Fake News.

Many researches from well know institution confirm the growth of fake news and the problem that this reality is generating in our society.


Another unquestionable fact that gives us a relevant measure of the face news and


Because of the Alarming Fake News Statistics, the interest about the fake news topic has also greatly increased


The frequency of "fake news" in Google Trends (2004-2018): https://ec.europa.eu/jrc/communities/sites/jrccties/files/dewp_201802_digital_transformation_of_news_media_and_the_rise_of_fake_news_final_180418.pdf

https://trends.google.com

https://www.mediawiki.org/wiki/Extension:HTML_Tags


According to a study conducted by Google, it is estimated that the number of false news has increased

Alarming Fake News Statistics

the rise of disinformation ...


the arrival of social media has meant real and fictional stories are now presented in such a similar way that it can sometimes be difficult to tell the two apart.

While the internet has enabled the sharing of knowledge in ways that previous generations could only have dreamed of, it has also provided ample proof of the line, often attributed to Winston Churchill, that "A lie gets halfway around the world before the truth has a chance to get its pants on". https://www.bbc.com/news/blogs-trending-37846860

https://www.bbc.co.uk/mediacentre/latestnews/2017/bbc-world-service-poll

https://www.bbc.com/news/technology-41319683


https://ec.europa.eu/jrc/communities/sites/jrccties/files/dewp_201802_digital_transformation_of_news_media_and_the_rise_of_fake_news_final_180418.pdf



emerge of viral fake news. Using row public data from Twitter, we are going to make an application that based on Machine Learning is able to detect viral fake news.