Obsolete Attribute

Định nghĩa Obsolete Attribute là gì?

Obsolete AttributeThuộc tính lỗi thời. Đây là nghĩa tiếng Việt của thuật ngữ Obsolete Attribute - một thuật ngữ thuộc nhóm Technology Terms - Công nghệ thông tin.

Độ phổ biến(Factor rating): 5/10

Một thuộc tính lỗi thời, trong C #, là một thẻ khai báo sử dụng trong khi tuyên bố một loại hoặc một thành viên của một loại để chỉ ra rằng nó không còn nên các thuộc tính used.Obsolete được sử dụng để hiển thị một lỗi hoặc cảnh báo trong biên soạn với một thông báo tùy chọn để cảnh báo nhà phát triển rằng loại nhất định hoặc thành viên của nó không nên được sử dụng trong các mã như nó sẽ được thay thế. Thông điệp hiển thị cũng có thể giải thích lý do tại sao các loại là lỗi thời cũng như cung cấp một sự thay thế. Bằng cách cung cấp một lời nhắc nhở liên tục về loại bỏ một số mã lỗi thời, lạc hậu thuộc tính giúp trong versioning chương trình phần mềm và phối hợp các phương pháp được sử dụng bởi các nhà phát triển khác nhau.

Xem thêm: Thuật ngữ công nghệ A-Z

Giải thích ý nghĩa

Một thuộc tính lỗi thời được khai báo trong dấu ngoặc vuông và với tham số tùy chọn đầu tiên là thông điệp được hiển thị trong kết quả của trình biên dịch. Bằng cách xác định các tham số lỗi tùy chọn thứ hai là đúng, thông báo sẽ được hiển thị như là một lỗi bởi trình biên dịch. Nếu không, các thông báo sẽ được hiển thị như một lời cảnh báo bởi trình biên dịch. Ví dụ, khi một phương pháp loại "getResult" của một đối tượng của "Sinh viên" kiểu này phải được đánh dấu là quá lỗi thời mà phiên bản sau này của nó, "GetLatestResult", có thể được sử dụng thay vào đó, phương pháp getResult phải được đánh dấu bằng một thuộc tính lỗi thời với một thông điệp như “Vui lòng sử dụng GetLatestResult thay vì getResult” với tham số lỗi như sai. Thông báo sẽ được hiển thị như một bộ sưu tập warning.Obsolete thuộc tính đóng một vai trò quan trọng trong việc thiết kế các thư viện phần mềm mà có được phát hành với phiên bản mới hơn, mà cần phải được sử dụng bởi các ứng dụng mà không vi phạm các ứng dụng hiện có. Do đó, các thuộc tính lỗi thời giúp đỡ trong việc sắp xếp, và duy trì khả năng tương thích ngược và bảo trì đang trong suốt vòng đời phát triển.

What is the Obsolete Attribute? - Definition

An obsolete attribute, in C#, is a declarative tag used while declaring a type or a member of a type to indicate that it should no longer be used.Obsolete attributes are used to display an error or warning during compilation with an optional message to alert the developer that the given type or its member should not be used in the code as it is going to be replaced. The displayed message can also explain the reason why the type is obsolete as well as provide an alternative. By providing a constant reminder about removal of some obsolete code, the obsolete attribute helps in versioning software programs and coordinating the methods employed by different developers.

Understanding the Obsolete Attribute

An obsolete attribute is declared within square brackets and with the first optional parameter as the message to be displayed in the output of compilation. By specifying the second optional error parameter as true, the message will be displayed as an error by the compiler. Otherwise, the message will be displayed as a warning by the compiler. For example, when a method of the type "GetResult" of an object of "Student" type has to be marked as obsolete so that its later version, "GetLatestResult", can be used instead, the GetResult method has to be marked with an obsolete attribute with a message such as “Please use GetLatestResult instead of GetResult” with error parameter as false. The message will be displayed as a compilation warning.Obsolete attributes play a vital role in the design of software libraries that get released with newer versions, which need to be used by applications without breaking the existing applications. Thus, obsolete attributes help in refactoring, and maintaining backward compatibility and code maintainability throughout the development life cycle.

Thuật ngữ liên quan

  • Compiler
  • Backward Compatible
  • Attribute
  • Reflection
  • Metadata
  • Commit
  • Access Modifiers
  • Acyclic
  • Appending Virus
  • Armored Virus

Source: ? Technology Dictionary - Filegi - Techtopedia - Techterm

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *