|
View:
New views
6 Messages
—
Rating Filter:
Alert me
|
|
|
class mapping E10: Avoid serializing JavaScript properties not part of Java classHere's a mail
thread for Randy's suggestion (included
below).
One suggestion
for how to solve this is adding information about members in our generated
mapped classes (see *):
if (typeof db.Person
!= 'function') {
db.Person = function() { this.myProp1 = <initial value> this.myProp2 = <initial value> } } db.Person["$dwrclassname"] = "db.Person";
* db.Person["$dwrclassmembers"] = { myProp1:true, myProp2:true
}; Then, when
engine.js does serialization of an object from a mapped class it can
do
for( element in obj.constructor["$dwrclassmembers"]
)
instead
of
for( element in obj
)
to only
serialize the known members and not everything on the
object.
Assigning
|true| to the properties in the classmembers list is just to have some value
that evaluates to true, in case someone wants to
do
if ( db.Person["$dwrclassmembers"].myProp1
)
In the future
it could also be extended to carry more information about the fields, f
ex data type.
Any comments on
this?
(I
can volunteer to implement this.)
Best
regards
Mike
|
|
|
|
|
|
RE: class mapping E10: Avoid serializing JavaScript properties not part of Java classSure, no probs.
Best regards
Mike
|
|
|
RE: class mapping E10: Avoid serializing JavaScript properties not part of Java classThis is now implemented and I have resolved http://bugs.directwebremoting.org/bugs/browse/DWR-267:
Best regards
Mike
|
|
|
Re: class mapping E10: Avoid serializing JavaScript properties not part of Java classThanks, Mike - I've just been looking through your check-ins and they all look very good. I've not played yet though. Have you seen the test-dwr project (alongside dwr in svn) I'm trying to add tests to that as I make changes. Joe. On Tue, Aug 12, 2008 at 1:39 PM, Mike Wilson <mikewse@...> wrote:
|
|
|
RE: class mapping E10: Avoid serializing JavaScript properties not part of Java classYes, and I've seen your mails about the testing framework.
Up until feature freeze at end of August all my available time will probably be
needed for adding features from my to-do list, but I hope to look at the
test stuff in September. I've just started working on a new day-time project, so
time is a bit short at the moment.
Best regards
Mike
|
| Free Forum Powered by Nabble | Forum Help |