• Что бы вступить в ряды "Принятый кодер" Вам нужно:
    Написать 10 полезных сообщений или тем и Получить 10 симпатий.
    Для того кто не хочет терять время,может пожертвовать средства для поддержки сервеса, и вступить в ряды VIP на месяц, дополнительная информация в лс.

  • Пользаватели которые будут спамить, уходят в бан без предупреждения. Спам сообщения определяется администрацией и модератором.

  • Гость, Что бы Вы хотели увидеть на нашем Форуме? Изложить свои идеи и пожелания по улучшению форума Вы можете поделиться с нами здесь. ----> Перейдите сюда
  • Все пользователи не прошедшие проверку электронной почты будут заблокированы. Все вопросы с разблокировкой обращайтесь по адресу электронной почте : info@guardianelinks.com . Не пришло сообщение о проверке или о сбросе также сообщите нам.

What I've learned about distributed services (part two)

Lomanu4 Оффлайн

Lomanu4

Команда форума
Администратор
Регистрация
1 Мар 2015
Сообщения
1,481
Баллы
155
Java is built in a way that developers are forced to always be doing exception handling. Period. It works by forcing the developer
a) to surround any line of code that might throw an exception with a try/catch block.
b) to declare ALL exception types involved in the throws clause (either not handled or thrown inside try/catch blocks).

Thus, ALL methods in Java can be seen as a gateway of exception types: they receive incoming exception types (originating in the methods called inside), and output a mix of old and new exception types (that the caller will, in turn, handle).

However, the compiler does NOT enforce these rules to runtime exceptions. This is the exception class hierarchy:


Object
└── Throwable
├── Error ← For serious problems (not meant to be caught)
└── Exception
├── RuntimeException ← Base for unchecked (runtime) exceptions
└── [Other Exceptions] ← Base for checked exceptions

You can then wonder, what if I use a runtime exception for my application? This would free me from writing exception handling code, wouldn't it?

As it turns out, this is (probably) your only option in the distributed realm.


Пожалуйста Авторизируйтесь или Зарегистрируйтесь для просмотра скрытого текста.

 
Вверх Снизу