Validation with pure Java; Build a solid foundation for the data- validation framework with the core Java API
The idea of constrained properties in Java is not new. Since JDK 1.1, a legion of JavaBeans developers has used a powerful framework found in the java.beans package to enforce data-validation rules. Unfortunately, the rest of us -- who are not in the business of crafting "reusable software comp...
Saved in:
Published in | Java world p. 1 |
---|---|
Main Author | |
Format | Magazine Article |
Language | English |
Published |
San Francisco
Foundry
29.12.2000
|
Online Access | Get full text |
ISSN | 1091-8906 1091-8906 |
Cover
Abstract | The idea of constrained properties in Java is not new. Since JDK 1.1, a legion of JavaBeans developers has used a powerful framework found in the java.beans package to enforce data-validation rules. Unfortunately, the rest of us -- who are not in the business of crafting "reusable software components that can be manipulated visually in a builder tool" -- quite often attempt to reinvent the wheel by abandoning the core Java approach in favor of various proprietary solutions. The externalization of data-validation rules is the area where you can see the most creativity. An interesting XML- based approach was recently proposed in the "Validation with Java and XML Schema" series of JavaWorld. While admiring XML technology, I believe that Java has everything needed to solve the issue in the most elegant way. To show you, I invite you to rediscover some of the real gems found in the java.beans package. They will help you build a few useful classes and learn a couple of interesting tricks. The logic behind constrained properties in Java is quite simple. Before accepting a new data value, the object (owner of the constrained property) makes sure it is accepted by all interested parties that may veto it. Such a "request for approval" is delivered to every registered java.beans.VetoableChangeListener in the form of a java.beans.PropertyChangeEvent object. If one or more vetoes have been issued, the proposed data value is rejected. A veto is presented by a java.beans.PropertyVetoException. Generally speaking, the complexity of the rules enforced by those listeners has no limit and depends only on the project's requirements and the developer's creativity. The objective of this exercise is to learn how to deal with the most generic data-validation criteria that you can apply to most objects. Although a fascinating subject, the implicit introspection is obviously not what you are going to rely upon in your quest for validation rules. One great thing about the BeanInfo class is its relation to the target class, which can be defined as a "rock-solid loose coupling." The absence of references from the target class makes the coupling very loose. Should the validation rules change, you just need to update and recompile the BeanInfo class without possibly affecting the target class. Clearly defined naming rules that are documented in the core Java API make compiling rock solid. This is where the rules-externalization approach with BeanInfo beats its proprietary-implemented counterparts hands down. |
---|---|
AbstractList | The idea of constrained properties in Java is not new. Since JDK 1.1, a legion of JavaBeans developers has used a powerful framework found in the java.beans package to enforce data-validation rules. Unfortunately, the rest of us -- who are not in the business of crafting "reusable software components that can be manipulated visually in a builder tool" -- quite often attempt to reinvent the wheel by abandoning the core Java approach in favor of various proprietary solutions. The externalization of data-validation rules is the area where you can see the most creativity. An interesting XML- based approach was recently proposed in the "Validation with Java and XML Schema" series of JavaWorld. While admiring XML technology, I believe that Java has everything needed to solve the issue in the most elegant way. To show you, I invite you to rediscover some of the real gems found in the java.beans package. They will help you build a few useful classes and learn a couple of interesting tricks. The logic behind constrained properties in Java is quite simple. Before accepting a new data value, the object (owner of the constrained property) makes sure it is accepted by all interested parties that may veto it. Such a "request for approval" is delivered to every registered java.beans.VetoableChangeListener in the form of a java.beans.PropertyChangeEvent object. If one or more vetoes have been issued, the proposed data value is rejected. A veto is presented by a java.beans.PropertyVetoException. Generally speaking, the complexity of the rules enforced by those listeners has no limit and depends only on the project's requirements and the developer's creativity. The objective of this exercise is to learn how to deal with the most generic data-validation criteria that you can apply to most objects. Although a fascinating subject, the implicit introspection is obviously not what you are going to rely upon in your quest for validation rules. One great thing about the BeanInfo class is its relation to the target class, which can be defined as a "rock-solid loose coupling." The absence of references from the target class makes the coupling very loose. Should the validation rules change, you just need to update and recompile the BeanInfo class without possibly affecting the target class. Clearly defined naming rules that are documented in the core Java API make compiling rock solid. This is where the rules-externalization approach with BeanInfo beats its proprietary-implemented counterparts hands down. |
Author | Okunev, Victor |
Author_xml | – sequence: 1 givenname: Victor surname: Okunev fullname: Okunev, Victor |
BookMark | eNqNzMEKgkAQxvElCtLqHaYHEHaVNOlUUVSnDtFVltxFS3dsd9XXz0ioY6f5Bn78XTJUqMSAOIzGzFvGNBz-7DFxjblTylgYLhxSXnmRp9zmqKDNbQZVrQWceMNXsKnzIgUOBjsCEmvVQ4kabCage7kHzbcgNS9Fi_rxab3NDfserM_HKRlJXhgx6--EzPe7y_bgVRqftTA20aJCbU3iBxGLqU-j4B_zAv6qSmA |
ContentType | Magazine Article |
Copyright | Copyright Web Publishing, Inc. Dec 29, 2000 |
Copyright_xml | – notice: Copyright Web Publishing, Inc. Dec 29, 2000 |
DBID | 3V. 7RQ 7XB 8AL 8FE 8FG 8FK ABUWG AFKRA ARAPS AZQEC BENPR BGLVJ CCPQU DWQXO GNUQQ HCIFZ JQ2 K7- M0N P5Z P62 PHGZM PHGZT PKEHL PQEST PQGLB PQQKQ PQUKI Q9U U9A |
DatabaseName | ProQuest Central (Corporate) Career & Technical Education Database ProQuest Central (purchase pre-March 2016) Computing Database (Alumni Edition) ProQuest SciTech Collection ProQuest Technology Collection ProQuest Central (Alumni) (purchase pre-March 2016) ProQuest Central (Alumni) ProQuest Central UK/Ireland Advanced Technologies & Aerospace Collection ProQuest Central Essentials ProQuest Central Technology Collection ProQuest One ProQuest Central Korea ProQuest Central Student SciTech Premium Collection ProQuest Computer Science Collection Computer Science Database Computing Database Advanced Technologies & Aerospace Database ProQuest Advanced Technologies & Aerospace Collection ProQuest Central Premium ProQuest One Academic (New) ProQuest One Academic Middle East (New) ProQuest One Academic Eastern Edition (DO NOT USE) ProQuest One Applied & Life Sciences ProQuest One Academic ProQuest One Academic UKI Edition ProQuest Central Basic |
DatabaseTitle | Computer Science Database ProQuest Central Student Technology Collection ProQuest One Academic Middle East (New) ProQuest Advanced Technologies & Aerospace Collection ProQuest Central Essentials ProQuest Computer Science Collection ProQuest Central (Alumni Edition) SciTech Premium Collection ProQuest One Community College ProQuest Central ProQuest One Applied & Life Sciences ProQuest Central Korea ProQuest Central (New) Career and Technical Education (Alumni Edition) Advanced Technologies & Aerospace Collection ProQuest Computing ProQuest Central Basic ProQuest Computing (Alumni Edition) ProQuest One Academic Eastern Edition ProQuest Technology Collection ProQuest SciTech Collection Advanced Technologies & Aerospace Database ProQuest Career and Technical Education ProQuest One Academic UKI Edition ProQuest One Academic ProQuest One Academic (New) ProQuest Central (Alumni) |
DatabaseTitleList | Computer Science Database |
Database_xml | – sequence: 1 dbid: 8FG name: ProQuest Technology Collection url: https://search.proquest.com/technologycollection1 sourceTypes: Aggregation Database |
DeliveryMethod | fulltext_linktorsrc |
Discipline | Computer Science |
EISSN | 1091-8906 |
ExternalDocumentID | 75451921 |
GroupedDBID | 0ZK 29J 2QL 2WC 3V. 4IJ 5GY 7RQ 7XB 8AL 8FE 8FG 8FK 8R4 8R5 96U ABUWG ACBMB ADEYR ADFRT AFAZI AFKRA ALMA_UNASSIGNED_HOLDINGS ARAPS AZQEC BENPR BGLVJ BPHCQ CCPQU DWQXO E3Z EBS EJD F8P FAC GNUQQ GOZPB GRPMH HCIFZ JQ2 K6V K7- LXL LXN LXO LXY M0N OK1 P62 PHGZM PHGZT PKEHL PQEST PQGLB PQQKQ PQUKI PROAC PUEGO Q2X Q9U U5U U9A UNMZH ZRQ ~X8 |
ID | FETCH-proquest_reports_2371902073 |
IEDL.DBID | 8FG |
ISSN | 1091-8906 |
IngestDate | Thu Aug 28 10:32:39 EDT 2025 |
IsPeerReviewed | false |
IsScholarly | false |
Language | English |
LinkModel | DirectLink |
MergedId | FETCHMERGED-proquest_reports_2371902073 |
PQID | 237190207 |
PQPubID | 46811 |
ParticipantIDs | proquest_reports_237190207 |
PublicationCentury | 2000 |
PublicationDate | 20001229 |
PublicationDateYYYYMMDD | 2000-12-29 |
PublicationDate_xml | – month: 12 year: 2000 text: 20001229 day: 29 |
PublicationDecade | 2000 |
PublicationPlace | San Francisco |
PublicationPlace_xml | – name: San Francisco |
PublicationTitle | Java world |
PublicationYear | 2000 |
Publisher | Foundry |
Publisher_xml | – name: Foundry |
SSID | ssj0011665 |
Score | 2.3114233 |
Snippet | The idea of constrained properties in Java is not new. Since JDK 1.1, a legion of JavaBeans developers has used a powerful framework found in the java.beans... |
SourceID | proquest |
SourceType | Aggregation Database |
StartPage | 1 |
Title | Validation with pure Java; Build a solid foundation for the data- validation framework with the core Java API |
URI | https://www.proquest.com/docview/237190207 |
hasFullText | 1 |
inHoldings | 1 |
isFullTextHit | |
isPrint | |
link | http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwfV1LSwMxEB60vXiqT7RqGcFrcDdZsxs8SCtda8FSRKW3ks0DPLht17a_382-PIjeAglDmCQzw8yX-QCuQxsxrkNNOFeUBFYpIkLJiJFcaW4k86xL6D9P-OgtGM9uZxU256uCVdY2sTDUeqFcjvyGsjD3XdQL75cr4kijXHG1YtDYhbbPqXDMDVH82BQRfF4wSbrWlyQSHv9lbgsfEu9Dp27mjP3yuA5gx6SH0KmZFbB6aEfw-Z6HxyXbEbpMKS43mcGx3Mo7HDgia5SYX5oPjbahRcqHGebhHDrQJ8HtjwRbA7BKWW6Na15ZyMP-9OkYruLh68OI1PueV5WEeaMOdgKtdJGaU0AZGG2YUMKyKDCuEb5nAq1kInyqEsXOoPu3nO5_k-ewV3xB9ymh4gJa62xjLnNnvE56hcp70B4MJ9OXb_O1lFA |
linkProvider | ProQuest |
linkToHtml | http://utb.summon.serialssolutions.com/2.0.0/link/0/eLvHCXMwlV1LTwIxEJ4gHPSEzyi-xkRvNi7t2mVjjAGF8A4xaLiR0nYTDwIiYPj3trsUD0aNtyZtvkOnnZlOZ-YDOA-iAuMqUIRzSYkfSUnCQDCiBZeKa8G8yAb0W21effLrveteChauFsamVTqdGCtqNZI2Rn5FWWBsF_WCu_EbsaRR9nPVMWgkp6KhFx_mxfZ-W3sw4r2gtFLu3leJg-svo_D9FRQza9Yg49vi1DRkSuV253H1BZHnMQ-lbZxJCqHHvynr2AJVNiHrWkFjMRH2FqT0cBuyjpcBl9d0B16fjXOdcCWhjbPieDbRWBdzcYMlS4ONAs2Re1EYrUiVzHCCxhlEmzJKcP6FELn0rQTLrrGtL2M8LHZqu3D25w7sQXo4Gup9QOFrpVkow4gVfG3b6HvaV1IMwjyVA8kOIPczTu63yVNYr3ZbzX6z1m4cwkZczJ6nhIZHkJ5OZvrYmPXp4GQpAITL_8jvE_YMuAs |
openUrl | ctx_ver=Z39.88-2004&ctx_enc=info%3Aofi%2Fenc%3AUTF-8&rfr_id=info%3Asid%2Fsummon.serialssolutions.com&rft_val_fmt=info%3Aofi%2Ffmt%3Akev%3Amtx%3Ajournal&rft.genre=article&rft.atitle=Validation+with+pure+Java%3B+Build+a+solid+foundation+for+the+data-+validation+framework+with+the+core+Java+API&rft.jtitle=Java+world&rft.au=Okunev%2C+Victor&rft.date=2000-12-29&rft.pub=Foundry&rft.issn=1091-8906&rft.eissn=1091-8906&rft.spage=1&rft.externalDocID=75451921 |
thumbnail_l | http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=/lc.gif&issn=1091-8906&client=summon |
thumbnail_m | http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=/mc.gif&issn=1091-8906&client=summon |
thumbnail_s | http://covers-cdn.summon.serialssolutions.com/index.aspx?isbn=/sc.gif&issn=1091-8906&client=summon |