Update README.md

This commit is contained in:
Daniel
2024-05-01 21:06:20 +03:00
committed by GitHub
parent f7d0031d09
commit 0bde91c835

View File

@@ -1,60 +1,55 @@
# Winx: Software Specification Language # Winx Language Documentation
Welcome to Winx, a powerful language for defining software specifications in a clear and structured manner. This README provides an overview of Winx and its features.
## Overview ## Overview
Winx is a domain-specific language (DSL) specifically designed for writing software specifications. It offers a concise syntax for describing both functional and non-functional requirements, interfaces, packages, and more. Winx is a domain-specific language designed to explicitly define interfaces and specifications for systems across various domains. It enables system architects and developers to declare critical and optional operations, specify constraints, and establish clear contracts within the system components. Winx supports the development of reliable systems by enforcing strict adherence to defined behaviors and performance metrics.
## Key Features ## Features of Winx
### Clear Syntax - **Type Safety:** Winx is built with strong typing to reduce errors at design time.
- Winx provides a clean and easy-to-understand syntax for defining various elements of software specifications. - **Modularity:** Encourages modular design by separating interface definitions from implementations.
- **Extensible Annotations:** Users can define custom annotations to enforce additional constraints or document behavior.
- **Clear Concurrency Specifications:** Offers annotations to manage concurrency control and transaction behavior.
### Hierarchical Structure ## Language Constructs
- Specifications can be organized hierarchically into packages, interfaces, and specifications, providing a clear structure for complex software systems.
### Non-Functional Requirements ### Keywords and Modifiers
- Winx allows you to define non-functional requirements such as performance, security, and reliability constraints using clear and concise syntax.
### Functional Requirements - `package`: Defines a collection of related interfaces and specifications.
- You can specify functional requirements, including input parameters, output types, and implementation details, using intuitive syntax. - `interface`: Declares a group of related methods that form a contract.
- `specification`: Provides concrete implementations of one or more interfaces.
- `critical`, `optional`: Modifiers that dictate the necessity of methods within interfaces and specifications.
- `implements`: Shows that a specification adheres to the contract of an interface.
### Importance Levels ### Basic Syntax Overview
- Winx supports specifying the importance level of requirements, allowing you to prioritize critical functionalities over optional ones.
### Access Modifiers Here is an outline of the basic syntax used in Winx:
- Access modifiers such as `public`, `protected`, `private`, and `default` can be applied to interfaces and functions, enabling fine-grained control over visibility and accessibility.
### Comments ```plaintext
- Winx supports both single-line and block comments, helping you document your specifications effectively. package PackageName {
[critical|optional] interface InterfaceName {
## Example [critical|optional] ReturnType MethodName(ParamType paramName) {
@AnnotationName : "Value";
```winx return ReturnType;
package Database {
interface Database {
public GetUserList(FLOAT[] x, STRING ag) {
@ExecTime: "10s";
@MaxReturnVals: "10s";
return INT x;
} }
} }
specification DatabaseAccess implements Database { specification SpecificationName implements InterfaceName {
critical DatabaseAccessMember { [critical|optional] ReturnType MethodName(ParamType paramName) {
optional @UserHasAdminAccess; // Method implementation
critical @UserIsNotBanned; return ReturnType;
result optional DatabaseAdminPanel;
result critical DatabaseVisualizerPanel;
result Clock;
}
public GetUserList(FLOAT[] x, STRING ag) implements DatabaseAccessImpl {
@ExecTime: "10s";
@MaxReturnVals: "10s";
return INT x;
} }
} }
} }
``` ```
### Defining Interfaces and Specifications
Interfaces in Winx define the blueprint of operations that any implementing specification must fulfill, whereas specifications provide the actual implementation logic for these interfaces.
### Annotations
Annotations in Winx provide essential metadata and constraints for methods within interfaces and specifications. Here are a few examples:
- `@ExecTime : "3s"`: Specifies that the execution time should not exceed 3 seconds.
- `@DataIntegrity : "High"`: Ensures high levels of data integrity during operations.