|
self-referential static members: msg#00026lang.scala
Hi, Regarding static members: it's my understanding they can be viewed as instances of a singleon object. However, I'm not able to acheive the effect I want in the following case, perhaps because it's more akin to viewing them as members of a metaclass. Here is an example in Java coming from the 'SimpleOrm' library: public class Employee extends SRecordInstance implements java.io.Serializable { public static final SRecordMeta meta = new SRecordMeta(Employee.class, "XX_EMPLOYEE"); // ie. SRecord objects describe SRecordInstances public static final SFieldString EMPEE_ID = new SFieldString(meta, "EMPEE_ID", 20, SCon.SFD_PRIMARY_KEY); ... } The salient feature of this is that it's necessary to to refer to Employee as a static member inside the employee class itself. How can I express this directly in Scala? Apologies in advance if this a failure on my part to RTM. Thanks very much for your time. Jason |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | syntax questions: 00026, Jason Kinzer |
|---|---|
| Next by Date: | Re: Some initial suggestions (or perhaps things I don't understand): 00026, Nathan Sobo |
| Previous by Thread: | syntax questionsi: 00026, Jason Kinzer |
| Next by Thread: | Re: self-referential static members: 00026, Nikolay Mihaylov |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |