Está en: | Home >> ISValidator >> Architecture | Domingo 6 de Abril de 2025 |
![]() | ![]() |
|
Architecture of ISValidatorThis page descibres the philosophy and architecture of development that is applied in ISValidator routines. If you want to see commented examples of the routines, has the page of examples to it. Philosophy of the routinesThe philosophy whereupon has designed ISValidator turns surroundings to the information. Let think about an atomic information, like can be the name of a person that the user introduces in the system, by a web or console interface On this information normally a series of processes is due to make: it must be model, be validated and processed, independent of if it is valid or no Normally at the time of making the management of a certain information this is not to the only one that we must manage, usually are more information, as it can be the surname, the second name, etc... Normally a certain information can undergo a validation by different restrictions, we put for example that to a name can be applied the restriction to be of certain lenght and not to contain numbers. They are two restrictions on an only one information Also usually occurs the case that the restrictions that it has to fulfill a information are in favor conditional of other information. Let put for example the typical questionnaire in wich if it is answered an answer affirmatively it must answer a series o questions, not if it has been answered negatively there are to answer. In this case the restrictions that they have to fulfill these other questions vary according to the question that disciminates. If the information to validate comes from an interaction with the user and this is not valid normally will have to let itself know to this for its correction. Components of ISValidatorIn order to medel this situation ISValidator routines are based on a series of components:
RestrictionsThe restrictions to apply to a certain information are model using the Constraint interface and its corresponding implementations. Each instance of a restriction is associate obligatorily to an one information (ConstraintContainer). Normally the restrictions provide the posibility of being used witout having to be associate to an information (ConstraintContainer) by means of the implememntation of a static method that makes the validation happening. This form to operate is not most habitual when several information are handled, but can be useful for validations of an one data. These components are the ones in charge to make the function of described validation in the presentation Atomic informationThe atomic informations are model using the ConstraintContainer interface. This name come because it contain the restrictions. One of the functions that makes it has the handling the flow of control between the different components that forms the routines Each atomic information normally will be represented by only one ConstraintContainer These components, along with the metacontainers are the ones in charge to make the function of model described in the presentation Assemblies of atomic informationThe assemblies of atomic information are model using MetaContainer interface. This name come since the function that make is to be a container of containers. These componentes are optional although normally they facilitate the work to handle several atomic information, when grouping them. These componentes, along with the containers are the ones in charge to make the function of model, described in the presentation. Processes of the informationThe processes of the information are model using two interfaces depending if the information is valid or no. In order to process the valid information the ValidConstraintProcesor interface is used and for the invalid information the InValidConstraintProcessor interface is used. These components are totally optional, making the function of proces described in the presentation |
|