SlideShare uma empresa Scribd logo
2.2. Tratamento de Exceções
Desenvolvedores de sistemas confiáveis freqüentemente se referem a erros como exceções porque erros
raramente se manifestam durante a atividade normal do sistema (Goodenough, 1975; Parnas & Würges,
1976). Em situações de erro, um componente gera exceções que modelam a condição de erro e o sistema
deve realizar o tratamento daquelas exceções (Lee & Anderson, 1990). Desta forma, tratamento de
exceções é a capacidade que um software possui de reagir apropriadamente diante da ocorrência de
exceções, continuando ou interrompendo sua execução, a fim de preservar a integridade do estado do
sistema (Garcia et al., 2001).
Quando um serviço requerido não pode ser realizado, ele retorna uma resposta anormal, ou exceção
(Figura 1a). Ao receber uma resposta anormal de um outro componente (exceção externa) ou levantar uma
exceção durante sua própria atividade normal (exceção interna), as atividades adequadas para tratamento
da exceção devem ser executadas. Um tratador de exceções é a parte da atividade anormal (ou
excepcional), é, portanto, a parte do código da aplicação que fornece medidas específicas da aplicação
para o tratamento da exceção levantada (Garcia et al., 2001). Este é vinculado a uma região particular do
código normal, chamada região protegida ou escopo de tratamento. Se uma exceção é levantada em uma
região protegida, o fluxo de controle normal é desviado para um fluxo de controle excepcional (Garcia et
al., 2001). Após o tratamento da exceção, o componente pode voltar a prover o serviço normal ou propagar
a exceção para um componente de mais alto nível.
Figura 1 - Programas Sequenciais
Extraído de:
DAMASCENO, K. et al. Tratamento de Exceções Sensível ao Contexto. Disponível em:
https://www.researchgate.net/profile/Carlos_Lucena2/publication/237679767_Tratamento_de_Excecoes_
Sensivel _ao_ Contexto/links/00b7d53c97551314b2000000/Tratamento-de-Excecoes-Sensivel-ao-
Contexto.pdf. Acessado em 03 mai 2020.

Mais conteúdo relacionado

Destaque

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
SpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Lily Ray
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
Rajiv Jayarajah, MAppComm, ACC
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
Christy Abraham Joy
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
Vit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
MindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
GetSmarter
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
Project for Public Spaces & National Center for Biking and Walking
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
Erica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Saba Software
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
Simplilearn
 

Destaque (20)

How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 
Introduction to C Programming Language
Introduction to C Programming LanguageIntroduction to C Programming Language
Introduction to C Programming Language
 

Tratamento de Exceções.pdf

  • 1. 2.2. Tratamento de Exceções Desenvolvedores de sistemas confiáveis freqüentemente se referem a erros como exceções porque erros raramente se manifestam durante a atividade normal do sistema (Goodenough, 1975; Parnas & Würges, 1976). Em situações de erro, um componente gera exceções que modelam a condição de erro e o sistema deve realizar o tratamento daquelas exceções (Lee & Anderson, 1990). Desta forma, tratamento de exceções é a capacidade que um software possui de reagir apropriadamente diante da ocorrência de exceções, continuando ou interrompendo sua execução, a fim de preservar a integridade do estado do sistema (Garcia et al., 2001). Quando um serviço requerido não pode ser realizado, ele retorna uma resposta anormal, ou exceção (Figura 1a). Ao receber uma resposta anormal de um outro componente (exceção externa) ou levantar uma exceção durante sua própria atividade normal (exceção interna), as atividades adequadas para tratamento da exceção devem ser executadas. Um tratador de exceções é a parte da atividade anormal (ou excepcional), é, portanto, a parte do código da aplicação que fornece medidas específicas da aplicação para o tratamento da exceção levantada (Garcia et al., 2001). Este é vinculado a uma região particular do código normal, chamada região protegida ou escopo de tratamento. Se uma exceção é levantada em uma região protegida, o fluxo de controle normal é desviado para um fluxo de controle excepcional (Garcia et al., 2001). Após o tratamento da exceção, o componente pode voltar a prover o serviço normal ou propagar a exceção para um componente de mais alto nível. Figura 1 - Programas Sequenciais Extraído de: DAMASCENO, K. et al. Tratamento de Exceções Sensível ao Contexto. Disponível em: https://www.researchgate.net/profile/Carlos_Lucena2/publication/237679767_Tratamento_de_Excecoes_ Sensivel _ao_ Contexto/links/00b7d53c97551314b2000000/Tratamento-de-Excecoes-Sensivel-ao- Contexto.pdf. Acessado em 03 mai 2020.