Force use of accessors? (getters & setters)

How to prevent/detect the incorrect direct use of properies in cf9 e.g.
aPerson.FirstName = "Rumplestiltskin";
...when a component is rewritten to use accessors e.g.
aPerson.setFirstName("Rumplestiltskin");
e.g. a component is changed from...
Component Person  {
    property name="FirstName" type="string";
...to...
Component Person accessors="true" {
    property name="FirstName" type="string" getter="true" setter="true";
1) Is it possible to prevent the propeties being set directly?
e.g. This should cause an error:
aPerson.FirstName = "Rumplestiltskin";
In practice, properties can still be set directly even though the component has declared that accessors should be used.  I want to make this illegal im my app.
2) Is it possible to prevent the use of undeclared properties?
e.g. This should cause an error:
aPerson.ChristianName = "Rumplestiltskin"; // non-existent property
or
aPerson.furstname = "Rumplestiltskin"; // Mis-spelt property
In practice, properties can be set even if they don't exist.  I want to make this illegal im my app.
3) Is it possible to intercept the direct use of properties
e.g. when this is executed...
aPerson.FirstName = "Rumplestiltskin";
..the function aPerson.setFirstName() is called
This would make it possible to solve 1), or better still, make the app backwardly compatible.
When an app is rewritten to use accessors, I don't want to have to change every instance of
aPerson.FirstName = "Rumplestiltskin";
...to...
aPerson.setFirstName("Rumplestiltskin");
...or at least, I want to be told if I've missed one.
Thanks,
Julian

System Information
Server Details
Server Product
ColdFusion
Version
9,0,0,251028  
Edition
Developer  
Operating System
Windows 7  
OS Version
6.1  
Adobe Driver Version
4.0 (Build 0005)  
JVM Details
Java Version
1.6.0_14  
Java Vendor
Sun Microsystems Inc.  
Java Vendor URL
http://java.sun.com/  
Java Home
C:\ColdFusion9\runtime\jre  
Java File Encoding
Cp1252  
Java Default Locale
en_GB  
File Separator
Path Separator
Line Separator
Chr(13)  
User Name
XXXX
User Home
C:\  
User Dir
C:\ColdFusion9\runtime\bin  
Java VM Specification Version
1.0  
Java VM Specification Vendor
Sun Microsystems Inc.  
Java VM Specification Name
Java Virtual Machine Specification  
Java VM Version
14.0-b16  
Java VM Vendor
Sun Microsystems Inc.  
Java VM Name
Java HotSpot(TM) Server VM  
Java Specification Version
1.6  
Java Specification Vendor
Sun Microsystems Inc.  
Java Specification Name
Java Platform API Specification  
Java Class Version
50.0  
CF Server Java Class Path
;C:/ColdFusion9/runtime/../lib/activation.jar;  C:/ColdFusion9/runtime/../lib/ant-launcher.jar;  C:/ColdFusion9/runtime/../lib/ant.jar;  C:/ColdFusion9/runtime/../lib/antlr-2.7.6.jar;  C:/ColdFusion9/runtime/../lib/apache-solr-core.jar;  C:/ColdFusion9/runtime/../lib/apache-solr-solrj.jar;  C:/ColdFusion9/runtime/../lib/asn1.jar;  C:/ColdFusion9/runtime/../lib/axis.jar;  C:/ColdFusion9/runtime/../lib/backport-util-concurrent.jar;  C:/ColdFusion9/runtime/../lib/bcel.jar;  C:/ColdFusion9/runtime/../lib/bcmail-jdk14-139.jar;  C:/ColdFusion9/runtime/../lib/bcprov-jdk14-139.jar;  C:/ColdFusion9/runtime/../lib/cdo.jar;  C:/ColdFusion9/runtime/../lib/cdohost.jar;  C:/ColdFusion9/runtime/../lib/certj.jar;  C:/ColdFusion9/runtime/../lib/cf-acrobat.jar;  C:/ColdFusion9/runtime/../lib/cf-assembler.jar;  C:/ColdFusion9/runtime/../lib/cf-logging.jar;  C:/ColdFusion9/runtime/../lib/cf4was.jar;  C:/ColdFusion9/runtime/../lib/cf4was_ae.jar;  C:/ColdFusion9/runtime/../lib/cfusion-req.jar;  C:/ColdFusion9/runtime/../lib/cfusion.jar;  C:/ColdFusion9/runtime/../lib/clibwrapper_jiio.jar;  C:/ColdFusion9/runtime/../lib/commons-beanutils-1.8.0.jar;  C:/ColdFusion9/runtime/../lib/commons-codec-1.3.jar;  C:/ColdFusion9/runtime/../lib/commons-collections-3.2.1.jar;  C:/ColdFusion9/runtime/../lib/commons-digester-2.0.jar;  C:/ColdFusion9/runtime/../lib/commons-discovery-0.4.jar;  C:/ColdFusion9/runtime/../lib/commons-httpclient-3.1.jar;  C:/ColdFusion9/runtime/../lib/commons-lang-2.4.jar;  C:/ColdFusion9/runtime/../lib/commons-logging-1.1.1.jar;  C:/ColdFusion9/runtime/../lib/commons-logging-api-1.1.1.jar;  C:/ColdFusion9/runtime/../lib/commons-net-2.0.jar;  C:/ColdFusion9/runtime/../lib/commons-vfs-1.0.jar;  C:/ColdFusion9/runtime/../lib/crystal.jar;  C:/ColdFusion9/runtime/../lib/derby.jar;  C:/ColdFusion9/runtime/../lib/derbyclient.jar;  C:/ColdFusion9/runtime/../lib/derbynet.jar;  C:/ColdFusion9/runtime/../lib/derbyrun.jar;  C:/ColdFusion9/runtime/../lib/derbytools.jar;  C:/ColdFusion9/runtime/../lib/dom4j-1.6.1.jar;  C:/ColdFusion9/runtime/../lib/ehcache-web.jar;  C:/ColdFusion9/runtime/../lib/ehcache.jar;  C:/ColdFusion9/runtime/../lib/FCSj.jar;  C:/ColdFusion9/runtime/../lib/flashgateway.jar;  C:/ColdFusion9/runtime/../lib/flex-messaging-common.jar;  C:/ColdFusion9/runtime/../lib/flex-messaging-core.jar;  C:/ColdFusion9/runtime/../lib/flex-messaging-opt.jar;  C:/ColdFusion9/runtime/../lib/flex-messaging-proxy.jar;  C:/ColdFusion9/runtime/../lib/flex-messaging-remoting.jar;  C:/ColdFusion9/runtime/../lib/geronimo-stax-api_1.0_spec-1.0.jar;  C:/ColdFusion9/runtime/../lib/hibernate3.jar;  C:/ColdFusion9/runtime/../lib/httpclient.jar;  C:/ColdFusion9/runtime/../lib/ib6addonpatch.jar;  C:/ColdFusion9/runtime/../lib/ib6core.jar;  C:/ColdFusion9/runtime/../lib/ib6http.jar;  C:/ColdFusion9/runtime/../lib/ib6swing.jar;  C:/ColdFusion9/runtime/../lib/ib6util.jar;  C:/ColdFusion9/runtime/../lib/im.jar;  C:/ColdFusion9/runtime/../lib/iText.jar;  C:/ColdFusion9/runtime/../lib/iTextAsian.jar;  C:/ColdFusion9/runtime/../lib/izmado.jar;  C:/ColdFusion9/runtime/../lib/jai_codec.jar;  C:/ColdFusion9/runtime/../lib/jai_core.jar;  C:/ColdFusion9/runtime/../lib/jai_imageio.jar;  C:/ColdFusion9/runtime/../lib/jakarta-oro-2.0.6.jar;  C:/ColdFusion9/runtime/../lib/jakarta-slide-webdavlib-2.1.jar;  C:/ColdFusion9/runtime/../lib/java2wsdl.jar;  C:/ColdFusion9/runtime/../lib/jax-qname.jar;  C:/ColdFusion9/runtime/../lib/jaxb-api.jar;  C:/ColdFusion9/runtime/../lib/jaxb-impl.jar;  C:/ColdFusion9/runtime/../lib/jaxb-libs.jar;  C:/ColdFusion9/runtime/../lib/jaxb-xjc.jar;  C:/ColdFusion9/runtime/../lib/jaxrpc.jar;  C:/ColdFusion9/runtime/../lib/jdom-1.0.jar;  C:/ColdFusion9/runtime/../lib/jeb.jar;  C:/ColdFusion9/runtime/../lib/jintegra.jar;  C:/ColdFusion9/runtime/../lib/jnbcore.jar;  C:/ColdFusion9/runtime/../lib/jpedal.jar;  C:/ColdFusion9/runtime/../lib/js.jar;  C:/ColdFusion9/runtime/../lib/jsch-0.1.41m.jar;  C:/ColdFusion9/runtime/../lib/jsr107cache.jar;  C:/ColdFusion9/runtime/../lib/jutf7-0.9.0.jar;  C:/ColdFusion9/runtime/../lib/ldap.jar;  C:/ColdFusion9/runtime/../lib/ldapbp.jar;  C:/ColdFusion9/runtime/../lib/log4j-1.2.15.jar;  C:/ColdFusion9/runtime/../lib/lucene-analyzers.jar;  C:/ColdFusion9/runtime/../lib/lucene.jar;  C:/ColdFusion9/runtime/../lib/lucenedemo.jar;  C:/ColdFusion9/runtime/../lib/macromedia_drivers.jar;  C:/ColdFusion9/runtime/../lib/mail.jar;  C:/ColdFusion9/runtime/../lib/metadata-extractor-2.4.0-beta-1.jar;  C:/ColdFusion9/runtime/../lib/mlibwrapper_jai.jar;  C:/ColdFusion9/runtime/../lib/msapps.jar;  C:/ColdFusion9/runtime/../lib/mysql-connector-java-commercial-5.1.7-bin.jar;  C:/ColdFusion9/runtime/../lib/namespace.jar;  C:/ColdFusion9/runtime/../lib/nekohtml.jar;  C:/ColdFusion9/runtime/../lib/ooxml-schemas.jar;  C:/ColdFusion9/runtime/../lib/pdfencryption.jar;  C:/ColdFusion9/runtime/../lib/poi-contrib.jar;  C:/ColdFusion9/runtime/../lib/poi-ooxml.jar;  C:/ColdFusion9/runtime/../lib/poi-scratchpad.jar;  C:/ColdFusion9/runtime/../lib/poi.jar;  C:/ColdFusion9/runtime/../lib/portlet_20.jar;  C:/ColdFusion9/runtime/../lib/postgresql-8.3-604.jdbc3.jar;  C:/ColdFusion9/runtime/../lib/relaxngDatatype.jar;  C:/ColdFusion9/runtime/../lib/ri_generic.jar;  C:/ColdFusion9/runtime/../lib/rome-cf.jar;  C:/ColdFusion9/runtime/../lib/saaj.jar;  C:/ColdFusion9/runtime/../lib/slf4j-api-1.5.6.jar;  C:/ColdFusion9/runtime/../lib/slf4j-log4j12-1.5.6.jar;  C:/ColdFusion9/runtime/../lib/smack.jar;  C:/ColdFusion9/runtime/../lib/smpp.jar;  C:/ColdFusion9/runtime/../lib/STComm.jar;  C:/ColdFusion9/runtime/../lib/tools.jar;  C:/ColdFusion9/runtime/../lib/tt-bytecode.jar;  C:/ColdFusion9/runtime/../lib/vadmin.jar;  C:/ColdFusion9/runtime/../lib/verity.jar;  C:/ColdFusion9/runtime/../lib/vparametric.jar;  C:/ColdFusion9/runtime/../lib/vsearch.jar;  C:/ColdFusion9/runtime/../lib/wc50.jar;  C:/ColdFusion9/runtime/../lib/webchartsJava2D.jar;  C:/ColdFusion9/runtime/../lib/wsdl2java.jar;  C:/ColdFusion9/runtime/../lib/wsdl4j-1.5.1.jar;  C:/ColdFusion9/runtime/../lib/wsrp4j-commons-0.5-SNAPSHOT.jar;  C:/ColdFusion9/runtime/../lib/wsrp4j-producer.jar;  C:/ColdFusion9/runtime/../lib/xalan.jar;  C:/ColdFusion9/runtime/../lib/xercesImpl.jar;  C:/ColdFusion9/runtime/../lib/xml-apis.jar;  C:/ColdFusion9/runtime/../lib/xmlbeans-2.3.0.jar;  C:/ColdFusion9/runtime/../lib/xmpcore.jar;  C:/ColdFusion9/runtime/../lib/xsdlib.jar;  C:/ColdFusion9/runtime/../lib/;  C:/ColdFusion9/runtime/../gateway/lib/examples.jar;  C:/ColdFusion9/runtime/../gateway/lib/;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/batik-awt-util.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/batik-css.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/batik-ext.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/batik-transcoder.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/batik-util.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/commons-discovery.jar;   C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/commons-logging.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/concurrent.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/flex.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/jakarta-oro-2.0.7.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/jcert.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/jnet.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/jsse.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/oscache.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/cfform/jars/;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/flex/jars/cfgatewayadapter.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/flex/jars/concurrent.jar;  C:/ColdFusion9/runtime/../wwwroot/WEB-INF/flex/jars/;  
Java Class Path
C:\ColdFusion9\runtime\servers\lib;
C:\ColdFusion9\runtime\servers\lib\jrun-patch.jar;
C:\ColdFusion9\runtime\..\lib\macromedia_drivers.jar;
C:\ColdFusion9\runtime\lib\cfmx_mbean.jar;
C:\ColdFusion9\runtime\..\lib\oosdk\classes;
C:\ColdFusion9\runtime\..\lib\oosdk\lib;
C:\ColdFusion9\runtime\..\lib\oosdk\lib\juh.jar;
C:\ColdFusion9\runtime\..\lib\oosdk\lib\jurt.jar;
C:\ColdFusion9\runtime\..\lib\oosdk\lib\ridl.jar;
C:\ColdFusion9\runtime\..\lib\oosdk\lib\unoil.jar;
C:\ColdFusion9\runtime\lib;
C:\ColdFusion9\runtime\lib\cfmx_mbean.jar;
C:\ColdFusion9\runtime\lib\instutil.jar;
C:\ColdFusion9\runtime\lib\java2wsdl.jar;
C:\ColdFusion9\runtime\lib\jrun-ant-tasks.jar;
C:\ColdFusion9\runtime\lib\jrun-xdoclet.jar;
C:\ColdFusion9\runtime\lib\jrun.jar;
C:\ColdFusion9\runtime\lib\jspc.jar;
C:\ColdFusion9\runtime\lib\migrate.jar;
C:\ColdFusion9\runtime\lib\oem-xdoclet.jar;
C:\ColdFusion9\runtime\lib\sniffer.jar;
C:\ColdFusion9\runtime\lib\webservices.jar;
C:\ColdFusion9\runtime\lib\wsconfig.jar;
C:\ColdFusion9\runtime\lib\wsdl2java.jar;
C:\ColdFusion9\runtime\lib\xmlscript.jar;
C:\ColdFusion9\runtime\lib\jrun.jar  
Java Ext Dirs
C:\ColdFusion9\runtime\jre\lib\ext;C:\Windows\Sun\Java\lib\ext  
Printer Details
Default Printer
Printers
Microsoft XPS Document Writer
Fax
Server Information
General Settings
Timeout requests
Yes  
Enable Per App Settings
Yes  
Request Time Limit
3600 seconds 
Use UUID for CFToken
No  
Enable Whitespace Management
Yes  
Disable Service Factory
No  
Protect serialized JSON
No  
Protect Serialized JSON Prefix
Missing Template Handler
Site-wide Error Handler
Enable HTTP status codes
Yes  
Enable Global Script Protection
Yes  
Default CFForm ScriptSrc Directory
/CFIDE/scripts/  
Google Map Key
Maximum size of post data
100 MB 
Request Throttle Threshold
4 MB 
Request Throttle Memory
200 MB 
Request Tuning
Simultaneous request limit
10  
Flash Remoting request limit
5  
Web Service request limit
5  
CFC request limit
10  
CFThread Pool Size
10  
Maximum number of report threads
8  
Request Queue Timeout
60 seconds 
Request Queue Timeout Page
Maximum number of running JRun threads
50  
Maximum number of queued JRun threads
1000  
Caching
Template cache size
1024 templates 
Enable trusted cache
No  
Cached query limit
100
Save Class Files
Yes  
Cache web server paths
No
Client Variable Settings
Default client variable store
Registry  
Client Stores
Registry  
Type
REGISTRY  
Description
System registry.   
Purge data after time limit
Yes  
Time limit
90 days 
Disable global updates
No  
Cookie  
Type
COOKIE  
Description
Client based text file.   
Purge data after time limit
Yes  
Time limit
10 days 
Disable global updates
No  
Memory Variables
J2EE Sessions
No  
Application Variables
Enable Application Variables
Yes  
Default Timeout
2,0,0,0  
Maximum Timeout
2,0,0,0  
Session Variables
Enable session variables
Yes  
Default Timeout
0,0,20,0  
Maximum Timeout
2,0,0,0  
ColdFusion Mappings
/gateway  
C:\ColdFusion9\gateway\cfc  
/CFIDE  
C:\inetpub\wwwroot\CFIDE  
Mail Connection Settings
Default Server Port
587  
Connection Timeout
60 seconds 
Spool Interval
15 seconds
Mail Delivery Threads
10  
Maintain Connection to Mail Server
No  
Spool Messages To
disk
Max Messages Spooled to Memory
50000  
Default CFMail Charset
UTF-8  
Use SSL Connection
No  
Use TLS
Yes  
Default Mail Server
smtp.gmail.com  
Server
smtp.gmail.com  
Port
587  
Username
XXXX
Password
not shown  
Mail Logging Settings
Log Severity
warning  
Log all E-mail messages sent by ColdFusion
No  
Charting
Cache Type
disk images 
Maximum number of images in cache
50 images 
Maximum number of charting threads
4  
Disk cache location
C:\ColdFusion9\charting\cache  
Java and JVM
Java virtual machine path
C:/ColdFusion9/runtime/jre  
Initial memory size
MB
Maximum memory size
512 MB
Class path
  -Dcoldfusion.classPath={application.home}/../lib/updates,{application.home}/../lib,{appli cation.home}/../gateway/lib/,{application.home}/../wwwroot/WEB-INF/cfform/jars,{applicatio n.home}/../wwwroot/WEB-INF/flex/jars  
JVM arguments
-server -Dsun.io.useCanonCaches=false -XX:MaxPermSize=192m -XX:+UseParallelGC -Dcoldfusion.rootDir={application.home}/../ -Dcoldfusion.libPath={application.home}/../lib  
Debugging & Logging
Debugging Settings
Enable debugging
Yes  
Enable Robust Exception Information
Yes  
Display format
classic.cfm  
Execution times
Yes  
Execution time format
summary  
Execution time highlight threshold
250 ms
Database activity
Yes  
Exception information
Yes  
Tracing information
Yes  
Timer Information
Yes  
Variables
Yes  
Variables
Application
Yes  
CGI
Yes  
Client
Yes  
Cookie
Yes  
Form
Yes  
Request
Yes  
Server
Yes  
Session
Yes  
URL
Yes  
Debugging IP Addresses
Debugging IP Address Restrictions
127.0.0.1
0:0:0:0:0:0:0:1  
Line Debugger Settings
Allow Line Debugging
NO  
Debugger Port
5005  
Max Simultaneous Debugging Sessions
5  
Logging Settings
Log directory
C:\ColdFusion9\logs  
Maximum file size
5000 KB
Maximum number of archives
10  
Log slow pages
No  
Slow page time limit
30 seconds 
Log CORBA calls
No  
Log scheduled tasks
No  
Schedule Tasks & Probes
Scheduled Tasks
System Probes
Extensions  
Java Applets
CFX Tags
Custom Tag Paths
C:\ColdFusion9/CustomTags  
CORBA
Selected connector
  [ none]   
Connectors
Event Gateways
Settings
Enable Event Gateway
Yes  
Thread Pool Size
1  
Max Queue Size
10  
Gateway Types
SMS  
Description
Handles SMS text messaging  
Class
coldfusion.eventgateway.sms.SMSGateway  
Timeout
30 seconds  
Kill On Timeout
Yes  
XMPP  
Description
Handles XMPP instant messaging  
Class
coldfusion.eventgateway.im.XMPPGateway  
Timeout
30 seconds 
Kill On Timeout
Yes  
SAMETIME  
Description
Handles Lotus SAMETIME instant messaging  
Class
coldfusion.eventgateway.im.SAMETIMEGateway  
Timeout
30 seconds  
Kill On Timeout
Yes  
DirectoryWatcher  
Description
Watches a directory for file changes  
Class
examples.watcher.DirectoryWatcherGateway  
Timeout
30 seconds 
Kill On Timeout
Yes  
Socket  
Description
Listens on a socket  
Class
examples.socket.SocketGateway  
Timeout
30 seconds  
Kill On Timeout
Yes  
CFML  
Description
Handles asynchronous events through CFCs  
Class
coldfusion.eventgateway.cfml.CfmlGateway  
Timeout
30 seconds 
Kill On Timeout
Yes  
JMS  
Description
Handles Java Messaging Service messages  
Class
examples.JMS.JMSGateway  
Timeout
30 seconds  
Kill On Timeout
Yes  
ActiveMQ  
Description
Handles Apache ActiveMQ JMS messages  
Class
examples.ActiveMQ.JMSGateway  
Timeout
30 seconds 
Kill On Timeout
Yes  
DataServicesMessaging  
Description
Handles Data Services Messaging messages  
Class
coldfusion.eventgateway.flex.FlexMessagingGateway  
Timeout
30 seconds  
Kill On Timeout
No  
FMS  
Description
Handles Flash Media Server shared objects  
Class
coldfusion.eventgateway.fms.FMSGateway  
Timeout
30 seconds 
Kill On Timeout
Yes  
DataManagement  
Description
Notifies Data Management Services of data changes  
Class
coldfusion.eventgateway.flex.FlexDataManagementGateway  
Timeout
30 seconds  

Similar Messages

  • Using 'variables.instance' structure and implicit getters/setters

    I am adopting the use of creating a variables.instance (I use 'variables.my') structure to separate instance data from the object, however I have a question when it comes to ColdFusion creating implicit getters and setters based on that object's defined properties.
    BEFORE, if I had a Name property, CF would create getName() and setName() for me, and it would update the variables.Name private variable accordingly in each.  But now that my variables are being stored in 'variables.my.Name', does this mean I can no longer use ColdFusion's implicit getters and setters? (because it would improperly be attempting to execute getName and be looking for variables.Name, when that data now exists in variables.my.Name?
    Are there any methodologies around that allow me to utilize CF's implicit getters/setters while using this 'my' instance variable and have them work with one another?

    Thanks for the confirmation Carl.
    How cool, then, would it be if ColdFusion 11 supported something like:
    <cfcomponent
         accessors="true"
         implicitpropertyprefix="my."
    That way I could specify "my." as the property prefix and when it goes to create those implicit getters and settings, it will concatenate that into 'variables.my.' as the prefix when it alters property values or returns them.

  • Getters & setters

    I am a newbie and trying to learn, I have a type & service table
    type
    t_id
    t_name
    blah
    blah
    service
    s_id
    t_id (fk)
    blah
    blah
    For a Add Screen, I have Type in a text field & JTable for the service (can be multiple for one type).
    Now normally when it is recommended to have getters & setters for everything, how do i have setters for the JTable (ie corresponding to the service table).
    I don't want to basically go back and forth the database 50 times , ie do the setter, insert to db, and repeat.
    Both are in the same screen as per the UI design ? How does everyone normally does this ?
    Thanks much

    Now normally when it is recommended to have getters & setters for everything, how do i have setters for the
    JTable (ie corresponding to the service table).That is not the normal recommendation:
    If and only if there is a compelling reason to expose the value of a field member of a class, you should do so through accessor methods, as this allows additional factilities (input validation, logging, etc) to be added and the implementation details to be changed.
    So it's not 'getters and setters for everything', but rather everything that needs to be accessed outside the class should use a getter or setter.
    Is there a compelling reason why the table should be accessible outside your GUI? Normally the view (in this case your JTable + the TableModel wrapper) asks a model (your data structure holding type and table, maybe reusing the generic ones supplied by Swing, maybe not) for the data, and doesn't expose the implementation of the view (the JTable) to the outside world.
    Imagine that, instead of using JTable, you changed your GUI to use a tree where the services were shown under the types; a local implementation change like that shouldn't effect any other part of your application, so only expose the parts of your view that are unchanged by such implementation details.
    Pete

  • Getters & Setters in ABAP?

    In C# and in Java we have special functions that operate on private class data called getters and setters.  These are almost always public and allow the "outside" to interact safely with the private class data.  An example would be :
    [C#]
    public class Vehicle
         private string _make;
         private string _model;
         public string Make { get { return _make; } set { _make = value; } }
         public string Model { get { return _model; } set { _model = value; } }
    [Java]
    public class Vehicle
         private string _make;
         private string _model;
         public string getMake() { return _make; }
         pubic string setMake(string value) { _make = value; }
         public string getModel() { return _ model; }
         public string setModel(string value) { _model = value; }
    This allows controlled access to the private data (_make and _model).  For instance, I can put rules into the setters that makes sure the data is valid that's coming in from the outside, or in both the setter and getter that checks the user's permissions to see if they have the right to access this data.  It's simply a way to implement "encapsulation".
    Does ABAP use getters/setters?  If so, are they implemented as in Java or does ABAP have its own implementation?
    Thanks!

    No reason to be sorry, I understand that you simply didn't know.    Here is the run-down.  You can award points to any answers that you find helpful.  If one answer in particular has solved your problem, you then mark the radiobutton next to that answer which is blue, this gives the person 10 points.  If the answer was very helpful,  then select the green star, this is 6 points to the user, and if helpful, mark yellow star for two points.  If not helpful at all, then don't mark any.  You can also,  mark the thread as "Solved on your own".  This closes the thread by giving it a blue star, but doesn't give any points to anyone(which is what you have done to the other posts  )   It is very good that you have closed the threads, because this gives visibility that your problem was solved or your question is answered.  But awarding 10 points to the answer which solved your issue, will also close the thread.   
    You can go back and revisit your other threads and award points according.
    Help this helps, and welcome to SDN.
    Regards,
    Rich Heilman

  • Hard to Write Good Getters/Setters

    I am thinking about writing a complex wrapper to set and get any floats/strings/ints. Cause hate how OBJ-C handles these references/values and having to deal with headers and main files everytime something changes is a real big headache. On top I hate having to decide if your instance variable should be handled like a reference (which can be shared) or a value (which cannot). Most of the time you want value semantics, but implementation efficiency often makes folks choose reference semantics. Your decision effects how you write your getters/setters. Had to figure this out for myself, as I never found any good explanation of it.
    Not only do you have to deal with the reference/value semantics issue, but reference counting, threading and exceptions also complicate the issue.
    I am should just write a class to handle all this junk and use the #import so I dont have so much incredible redundant code that OBJ-C somehow needs.
    my plan:
    MyClass.SetInt(intname, x);
    SetInt, this will overwrite/declare an existing int variable by that name held in the class.
    x = MyClass.GetInt(intname);
    GetInt, this retrieves an existing int variable by that name held in the class - or returns nil if undeclared.
    but this is all fantasy, still .... I just might try it.

    well, i've been asked to do it.
    I'll make a short overview : I have a program that creates an XML file with some information about a workflow diagram. The company that requires this software wants to get the execution trace that create the XML file, apart from the XML itself, so they can freely modify it without the need of using my app. My app uses their libraries to write the XML. They could overwrite the XML directly but they already got the libraries and the parser to access each element.
    So, they want the execution trace of the code that generates the XML.I think you're going to be far better off inserting logging statements into your code, and building a small self-contained example from the output of those statements.
    If you don't want to do that, and are comfortable with JNI, you can write a trace agent using JVMTI
    Or, you can use aspect-oriented programming to add cutpoints to their methods, with a tool such as [Aspect-J|http://www.eclipse.org/aspectj/]
    There's also a "trace" command in JDB. Haven't used it, so can't tell you whether it will tell you everything you need.
    And there used to be a tracing interface that could be accessed from Java code. At least I seem to remember writing a trace utility in Java. Could be that it's available on the JRockit JVM and not Sun.

  • Lack of support for Google Chrome in forced-use email app

    If this isn't resolved, I will cancel all Verizon services.  Am seeing a consistent decline in VZ services:
    1. ghosting and massive digital artifacts in HD programming, INCLUDING "Premium" channels
    2. HD set top box quality is very poor
    3. High pricing
    4. VZ has terminated use of preferred browser (Chrome, which is SECURE and much faster than any others) in new forced-use email client.
    As expected, VZ is acting once again as if they were "the phone company".
    Not true.
    Expect this post to be taken down quickly.

    Going to side with Justin here as well (and those of us who have been here for a while know, like ourselves, that he isn't a Verizon employee)  ... the issues being described are indicative of a local inside wiring problem (poor cabling, loose connections, unterminated/noise introducing cable outlets, etc.).   Since the TV is indicating problems, it's likely also interfering with the MoCA signal to the modem which would result in internet issues as well.
    I can second my experience with Chrome as well ... it works just fine with Verizon webmail.  Just tried it again to be sure.
    If you are encountering problems, it would be helpful if you could be more specific.  I suspect the you have an anti-virus / malware product that is probably set to block certain kinds of traffic (like Javascript, etc.) that is potentially interfering.   The solution in such cases is to whitelist the Verizon site as a known location -- how to do that however is a function of your anti-virus/anti-malware product.
    As for cost, I've been a customer for several years now.  My rate went up by $10 once in that time and I ended up rebundling my STB's and essentially negating that increase.  Compared to my cable provider -- who I continue to evaluate every year for cost/speed (while I like FiOS, I believe in fair competition and the best price / speed will always win my business) -- they are still the best deal for my money (don't get me wrong, cheaper or more bundle optons would be better!).  YMMV. 

  • Effect of Force use of non-existing index in program

    Hi,
    What is the Effect of Force use of non-existing index in program?
    We have forced the use of a custom index in our program, i want to know the effect in the program if in the future this index will be deleted or removed from the database?
    Thanks a lot!

    Hi Freishz,
    >
    freishz wrote:
    > What is the Effect of Force use of non-existing index in program?
    > We have forced the use of a custom index in our program, i want to know the effect in the program if in the future this index will be deleted or removed from the database?
    Hints note, it is a hint not a command, are ignored by the optimizer if they are not
    syntactically and/or semantically correct. An index hint pointing to a non-exisitng index
    is semantically not correct -> will be ignored. (A normal costing with the available indexes
    is done).
    Kind regards,
    Hermann

  • I am unable to download photos from iPhone 4, SD card and SLR camera to iPad 2 using apple accessories. It worked once and then never again. Any ideas ?

    I am unable to download photos from my iphone4 , SD card , SLR camera to my ipad2 using apple accessories , please help , it has worked once and then never again.

    Plumchunks-
    The only accessory I know of that can be used to transfer photos from a camera or SD card to the iPad, is the Apple Camera Connection Kit.  The kit consists of two adapters.  One has an SD card socket.  The other has a USB connector to connect directly to the camera.
    I do not think you can transfer photos from the iPhone to the iPad unless you first transfer them to a computer.  If you then transfer the photos to an SD card, they must have eight character names plus suffix and be stored in a DCIM folder, just as if they came from a camera.
    One thing you can try is to reboot the iPad.  Hold both the Home and Sleep buttons for several seconds until the Apple logo appears.  Ignore the "Slide to power off" arrow.  The iPad will restart after a couple of minutes.  Rebootting will not hurt anything and sometimes clears up mysterious problems.
    Fred

  • HT201699 if both wifi and apn is available,can I force use apn? thankyou.

    dear friends:
    if both wifi and apn is available,can I force use apn? thank you very much.

    The iPhone does this automatically - has since the original iPhone and iOS 1.0 was released 5 years ago.
    If you have wi-fi enabled and your iPhone is in range of an available wi-fi network the iPhone has connected with before, your iPhone will connect to that wi-fi network automatically. When leaving the range of the wi-fi network, the iPhone switches to cellular data automatically. This swich back and forth is automatic and seamless for wi-fi networks your iPhone has connected with in the past.
    The iPhone will connect to the fastest internet connection available, but not automatcally for a wi-fi network your iPhone has not connected with before.

  • [SLVD] force using /usr/lib/xorg/modules/updates/extensions/libglx.so

    Latest versions of catalyst bring powerXpress support - it means that we can now switch between discreet AMD gfx driver and integrated intel gfx driver (and maybe also switch between catalyst and ati oss driver).
    I'm working on it now, unfortunatelly it's not that easy to implement in a right way in Arch. There's no way without doing some ugly tricks (like creating /usr/X11R6 dir). Although i must say that i almost succeeded.
    Yes, i know that /usr/X11R6/lib is obsolete and not supported by Arch, but i must to place catalyst's libGL.so somewhere so it wouldn't conflict with libgl's libGL.so (+ more important is to be able to update libgl package without problems), and that directory is looking good.
    Basically this whole powerXpress suport = linking libGL and libglx libraries into right place. Let me show you some functions:
    switching libGL:
    function switch_to_amd() {
    ln -snf /usr/X11R6/lib/fglrx/fglrx-libGL.so.1.2 \
    /usr/X11R6/lib/libGL.so.1.2
    ln -snf libGL.so.1.2 /usr/X11R6/lib/libGL.so.1
    ln -snf libGL.so.1 /usr/X11R6/lib/libGL.so
    ldconfig /usr/X11R6/lib
    function switch_to_intel() {
    ln -snf /usr/lib/libGL.so.1.2 \
    /usr/X11R6/lib/libGL.so.1.2
    ln -snf libGL.so.1.2 /usr/X11R6/lib/libGL.so.1
    ln -snf libGL.so.1 /usr/X11R6/lib/libGL.so
    ldconfig /usr/X11R6/lib
    switching libglx:
    function switch_to_amd() {
    ln -snf /usr/lib/xorg/modules/updates/extensions/fglrx/fglrx-libglx.so \
    /usr/lib/xorg/modules/updates/extensions/libglx.so
    function switch_to_intel() {
    ln -snf /usr/lib/xorg/modules/extensions/libglx.so \
    /usr/lib/xorg/modules/updates/extensions/libglx.so
    I've created /etc/ld.so.conf.d/catalyst.conf with:
    /usr/X11R6/lib
    inside. I've also added /usr/X11R6/lib into PATH in /etc/profile in 1st place (just in case).
    And it's working fine (i mean catalyst is working fine) untill i will install libgl (so it's not fine)... After restart, when running X server screen goes blank and i cannot do anything (even when it's switched to amd). /var/log/Xorg.0.log looks fine, no errors, it's longer than usuall with those lines:
    [ 2515.883] (II) Power Button: Close
    [ 2515.883] (II) UnloadModule: "evdev"
    [ 2515.883] (II) Unloading evdev
    [ 2515.895] (II) Power Button: Close
    [ 2515.895] (II) UnloadModule: "evdev"
    [ 2515.895] (II) Unloading evdev
    [ 2515.911] (II) My keyboard: Close
    [ 2515.911] (II) UnloadModule: "evdev"
    [ 2515.911] (II) Unloading evdev
    [ 2515.926] (II) My keyboard: Close
    [ 2515.926] (II) UnloadModule: "evdev"
    [ 2515.926] (II) Unloading evdev
    [ 2515.942] (II) My Mouse: Close
    [ 2515.942] (II) UnloadModule: "evdev"
    [ 2515.942] (II) Unloading evdev
    [ 2515.947] (II) fglrx(0): Shutdown CMMQS
    [ 2515.948] (II) fglrx(0): [uki] removed 1 reserved context for kernel
    [ 2515.948] (II) fglrx(0): [uki] unmapping 8192 bytes of SAREA 0x2000 at 0x7fdc4f862000
    [ 2515.962] (II) fglrx(0): Interrupt handler Shutdown.
    but it doesn't look relevant.
    I don't know is it:
    - /usr/X11R6/lib that is chosen after /usr/lib
    - OR /usr/lib/xorg/modules/updates/extensions/ that is chosen after /usr/lib/xorg/modules/extensions/  - i though that updates should be taken in 1st place by default
    Maybe both of them?
    Right now i'm thinking that this is the problem of /usr/X11R6/lib that need to be taken before /usr/lib, so my question is same as the question in topic of this post.
    I will really appreciate any help.
    Btw: there's only one file in /usr/X11R6/lib : /usr/X11R6/lib/fglrx/fglrx-libGL.so.1.2
    + there's only one file in /usr/lib/xorg/modules/updates/extensions : /usr/lib/xorg/modules/updates/extensions/fglrx/fglrx-libglx.so
    I took this whole solution and scripts from SUSE (AMD's solution is really ugly). SUSE also doesn't like /usr/X11R6/lib, but they used it and there it seems to work. I mean i don't have SUSE, i just see their catalyst packaging script.
    Last edited by Vi0L0 (2011-05-15 10:02:32)

    Lone_Wolf wrote:
    've installed libgl, then removed /usr/lib/libGL.so* and problem persist. Then i reinstalled libgl, and removed /usr/lib/xorg/modules/extensions/libglx.so - it was working fine...
    This may be because of  a fallback option that if libglx.so is not found , xorg uses libglx.xorg .
    But libglx.so owned by catalyst (/usr/lib/xorg/modules/updates/extensions/libglx.so) should be found, and is found if only libglx.so owned by libgl (/usr/lib/xorg/modules/extensions/libglx.so) is not present. And if the last one is absent i can see in Xorg.0.log that xserver/catalyst is using that one placed in updates dir, not libglx.xorg.
    Now i removed libgl, and removed /usr/lib/xorg/modules/updates/extensions/libglx.so, so catalyst should got troubles, restart X and same problem: blank screen with only one char sign on top left corner: _
    So obviously catalyst need that /usr/lib/xorg/modules/updates/extensions/libglx.so
    I just don't know how to force using /usr/lib/xorg/modules/updates/extensions directory over /usr/lib/xorg/modules/extensions dir...
    Maybe i need something like LD_PRELOAD or something.
    This maybe not clear but what i'm trying to reach right now is to get catalyst working when libgl package is present, cuz it's looking like good begining.
    Lone_Wolf wrote:It does look like xorg doesn't entirely folllow ldconfig / symbolic links , so i'm inclined to suggest to keep things as simple as possible and change only what's really necessary .
    Ofcourse, i also don't like this whole /usr/X11R6/lib thing. Hell no, i even don't got intel gfx , i'm only trying to implement something that can be usefull for others.
    And since SUSE know how to use /usr/lib/xorg/modules/updates/extensions directory over /usr/lib/xorg/modules/extensions i'm sure it's also possible in Arch. Maybe the right and only way is to change something in xserver compilation, i don't know. Right now i'm trying to do this in "easier" way.
    Lone_Wolf wrote:
    As your libraries have different names as the mesa ones :
    place fglrx-libGL.so.1.2 in /usr/lib
    put fglrx-libglx.so in /usr/lib/xorg/modules/extensions
    for libgl only change the symbolic link just above the binary :  /usr/lib/libGL.so.1
    for libglx change /usr/lib/xorg/modules/extensions/libglx.so
    That ofcourse should work - since it will link to proper libs.
    But it's not what i'm trying to reach : catalyst and libgl installed without conflicts.
    Lone_Wolf wrote:If that works, you'll atleast know the switch is possible.
    Just a mention: this whole linking thing isn't anything new, it was used by linux users for long time so such switch is possible (as i can see they used to use such linking as you suggested but imho it's bad way - it should to be done without pacman's conflicts), now ati is just trying to implement it by default.
    This powerXpress support is still in developement, although i can see what way ati picked up, i'm trying to follow it and i'm pretty sure that it will work if i will follow it. The sooner - the better.

  • Help using getters & setters

    I am wanting to make a bean that will connect to a database and bring back data depending on what was entered in a html form. I have been told it would be easier if i make a bean that holds details of a single video. I have done this below, my question is in the servlet that connects to the database how will i use the result set to use these getters and setters?
    package site;
    public class vidBean
         //protected variables
         protected int recording_id;
         protected String title;
         protected String category;
         public void setRecId(int Rec)
              recording_id = Rec;
         public int getRecId()
              return recording_id;
    ... etc

    something likeList<VidBean> videos = new ArrayList<VidBean>();
    while(rs.next()) {
        VidBean video = new VidBean();
        video.setRecId(rs.getInd("id"));
        video.setTitle(rs.getString("title"));
        video.setCategory(rs.getString("category"));
    }

  • How to use javasetters and getters in different classes

    how to use setters and getters in different class so that the setvalue in one class is effect in second class for getting

    If i got your question right,
    make sure your classes are in the same package
    make sure your getters are public/protected
    make sure your code calls the setter before calling the getter
    Kind regards

  • Generating Getters/Setters/Interface methods

    Hi All,
    Quick question, ive used Eclipse before, and in it you can generate getters and setters for your class variables
    as well if you have a class that IMPLEMENTS some interface
    it also could let you generate the methods from that interface.
    Can JES 8 do this?
    Let me know how, i am kind of tired of writing myself.
    Thank you everyone

    The getter/setter generator is accessible from the Refactoring menu, in both the main menu and the editor context menu. It is referred to as Encapsulate Fields.
    Implementing methods is available via the keyboard shortcut Ctrl-i and in the Tools menu as "Override Methods".

  • Getters/Setters controversy

    So I'm going back and forth about whether or not to use getters and setters and any alternatives if I don't. I've read some articles that say getters and setters should be avoided at all cost.
    But I have an example program here, with a class called FlightInfo which basically holds all of the flight information such as flight date and the flight number. Wouldn't it be easiest to use getters and setters like the following:
    public class FlightInfo {
            private String date;
            private int flightNumber;
            public String getDate(){
                    return date;
            public setDate(String date){
                    this.date = date;
            public int getFlightNumber(){
                    return flightNumber;
            public setFlightNumber(String flightNumber){
                    this.date = flightNumber;
    }Is there any better alternative to this? Also, the flight date may change for a particular flight number.
    Thanks.
    Edited by: java_fan_69 on Dec 5, 2007 10:33 AM

    This:
            private String date;
            private int flightNumber;
            public String getDate(){
                    return date;
            public setDate(String date){
                    this.date = date;
            public int getFlightNumber(){
                    return flightNumber;
            public setFlightNumber(String flightNumber){
                    this.date = flightNumber;
            }has the same exact effect as this:
            public String date;
            public int flightNumber;They both allow you to access and modify the variables. I tend to favor using getters and setters, even when they don't add anything a) for consistency, so I can always find what I need in the methods, and b) in case they need to change later. For instance, you want to do some check on the flightNumber before setting it, or perhaps return the date in a different format in certain conditions.

  • Sets, getters, setters, adders, iterators...

    After reading the highly interesting thread about getters and setters and their implications over OO-design, I'm wondering how to manage sets elegantly... and actually any Collection
    Let's say I have a class A that has to reference a set of objects (meaning, as everyone knows, these objects needn't be ordered and can appear only once in the collection)
    As Peter answered, I should go for getters of the like "getObject(int)" with the help of a "nbOfObjects()" method... alright... that seemed logical for ordered data structures like lists... now, how would you manage that with sets, since an indexed "get()" doesn't make much sense... as stated in the Javadoc, the Set contract doesn't guarantee that the order remains the same, so does something like this make sense ?
    class A {
       private Set set = Collections.synchronizedSet(new HashSet()); // or should I declare it as a Collection, even if I know no element should appear twice ? I suppose not...
       // Does it make sense ?
       public Object getObject(int i) {
          Object[] objectArray = set.toArray(); // called every time the user iterates further... looks like ugly overhead to me...
          return objectArray; // or objectArray[i].clone() ?
    If it DOESN'T make sense, how would you iterate over a Set ? Is returning an iterator the only way ? a clone of the collection to allow the user of the getter to use enhanced for-loop (what are its uses otherwise except for "class-internal-iterating" ?) ?
    I'm both interested and confused since I've read this thread which shakes the very foundations of my conceptions on that matter ^^
    thx a lot for any help, examples, comments or links (not too many, plz, I prefer cut&pastes, I'm out of Internet quota for this month at work :p (thank god, I had them make *.sun.com free ^^)) you could provide

    My first point is, make the set private final
    Secondly an index to a HashSet is dangerous concept
    as the order can be completely re-ordered when an
    element is added.
    A better choice would be LinkedHashSet which has a
    consistent ordering.didn't know about that class... interesting indeed :)
    >
    I would suggest that if you need to return the
    collection use Collections.unmodifable or a copy.didn't know about Collections.unmodifiableX() either... sounds great but it looks like an ugly workaround for java's lack of 'const' keyword : / throwing an UnsupportedOperationException at runtime sounds less safe than enforcing constant operations at compile time, doesn't it ?
    >
    As you have a synchronised connection, multithreading
    may be an issue. (ie the size could change while
    another thread is "iterating")
    With the HashSet reordering on an insert could mean
    the same object appearing more than once. e.g.
    appearing at the start of a list and a moment later
    at the end.
    One approach is to maintain an array when the set
    changes and return that.
    private static final String[] NO_STRINGS = new
    new String[0];
    private final Set set =
    et = Collections.synchronizedSet(new
    LinkedHashSet());
    private String[] setItems = NO_STRINGS;
    public void add(String string) {
    synchronized(set) {
    set.add(string);
    setItems = (String[])
    = (String[]) set.toArray(NO_STRINGS);
    public String[] getSet() {
    return setItems;
    Sorry but I find this solution a bit weird... updating two representations of the same data each time a piece of data's added is the kind of things I want to avoid... what's more, using synchronised collections should shield you from having to write "synchronized" all over the place IMHO... what's the point in using a synchronized collection to add to your class an unsynchronized copy ? then you'd be better off synchronizing your add method and using an unsynchronized collection... you're supposed to never access the original collection anywhere else than in its class anyway...
    what about :
    public class A {
       private final Set set = Collections.synchronizedSet(new LinkedHashSet());
       public void addToSet(Object o) {
          set.add(o); // thread-safe anyway, ain't it ?
       public Iterator getObjects() {
          Set constCollection = Collections.unmodifiableSet(set);
          return constCollection.iterator();
       // OR... (can one of the above and below constructs be considered as "better OO" than the other ? if so, why ?)
       public  Collection getObjects() {
          return Collections.unmodifiableSet(set);
    }still a bit lost, but I feel I begin to see the light... :p

Maybe you are looking for

  • The bar for the website address is just gone, how do i get it back?

    there is no website address at the top ^ it just shows my tabs and under that the toolbar, i cant seem to fix it or find the solution.

  • Selection screen fields in query

    experts i have created a query with 5 selection screen fields, now i want to change the order of the fields in the selection screen. Earlier: Material order delivery qty amount Now i want order material delivery amount qty In sq01 i tried but there a

  • Slow startup mac os x 10.6.5 due to update

    I have a macbook pro 13 inch (2.4GHz) which was recently purchased. the startup was initially fast, it would take about 10secs to boot but after the update (mac os x 10.6.5) i realised that startup is now even longer. it is now 1min an a half sum may

  • Query performance concerning order by

    Hi The following query taks 0.2 seconds select * from messagerecipients order by messageid Also the following one takes same amount of time select * from messagerecipients order by groupid I want to order by both messageid and groupid so I try both t

  • When opening a new tab, IE9 opens a blank page, not the new tab page

    I change my settings to open a the new tab page when I open a new tab. This works for one boot of Windows. Second boot, the settings have magically changed back to opening a blank page. It worked to start with. I only just reinstalled Windows on this