Java-based code snippet failure strategy protection method and device
A code fragment and strategy technology, applied in the basic field, can solve the problems of complicated writing, reduce code maintainability, code repetition, etc., and achieve the effect of improving code maintainability, strong readability, and strong scalability
- Summary
- Abstract
- Description
- Claims
- Application Information
AI Technical Summary
Problems solved by technology
Method used
Image
Examples
Embodiment Construction
[0015] In order to make the technical means, creative features, goals and effects achieved by the present invention easy to understand, the present invention will be further described below in conjunction with specific embodiments.
[0016] refer to figure 1 , the present embodiment adopts the following technical solutions: a method for Java-based code fragment failure policy protection, the steps of which are:
[0017] (1) Encapsulate the container class that transmits the result value and exception at the same time.
[0018]
[0019]
[0020] (2) Abstract a given code fragment as an execution context.
[0021]
[0022]
[0023] (3) Define the strategy interface. The strategy needs to be implemented to get an execution context (Execution) and return its execution result or exception.
[0024] public interface Policy {
[0025] Either execute(Execution execution);
[0026] }
[0027] (4) An executor for constructing policy combinations, allowing multiple...
PUM
Abstract
Description
Claims
Application Information
- R&D Engineer
- R&D Manager
- IP Professional
- Industry Leading Data Capabilities
- Powerful AI technology
- Patent DNA Extraction
Browse by: Latest US Patents, China's latest patents, Technical Efficacy Thesaurus, Application Domain, Technology Topic.
© 2024 PatSnap. All rights reserved.Legal|Privacy policy|Modern Slavery Act Transparency Statement|Sitemap