I'm wondering if there is a way to incorporate temp-table/prodataset as a property to a class, specially when creating System.EventArgs derived class, or at least something that will achieve the same effect like maybe a method with INPUT-OUTPUT parameter.
Thanks,
Wouldn't this be violating a basic tenet of OO design by making the implementation visible outside of the class?
That is very much true for full-pledge object that wraps a temp-table, or a collection that wraps a prodataset. But there are cases where the temp-table is just data, and as for EventArgs, it is very likely that the mutation to its properties --- outside of initialization --- will be handled by the consuming class or object anyways.
Thanks,
While we're in this topic, will there be an equivalent tool like in Visual Studio that generates a custom class based on a temp-table or prodataset? I think that will be a helpful tool for writing model.
[quote user="Peter Judge"]
[/quote]
Peter, why is JsonObject getter ugly? I just made a class that adds kind of name and value records to a template, and since I needed it as json, I made a jsonobject getter. Works swell, but now i am kind of curious of what ugly code that is?
Update from Progress Community
Peter Judge You can't define property as a temp-table or dataset type, nor can you define a temp-table/dataset as public in a class.You'll have to either- expose it as a handle- return it as an output parameter in a method- add read/write methods to expose certain aspects of data- ugly: define a JsonObject property with getter and setter methods that READ-JSON and WRITE-JSONThose are the approaches off the top of my head. There will be others, but the moral of the story is that there's no easy/pretty/good way of doing this yet.-- peterYou received this notification because you subscribed to the forum. To unsubscribe from only this thread, go here.
Flag this post as spam/abuse.
> While we're in this topic, will there be an equivalent tool like in Visual Studio that generates a custom class based on a temp-table or
> prodataset? I think that will be a helpful tool for writing model.
Something along the lines of a tool that takes a (db or TT) schema and (basically) creates an ActiveRecord representation of it? I don't know whether that (or anything that's close to an ORM) would be the best "ABL way" of approaching strongly-typed data.
What are you trying to do with this object? There are ways - a handle-wrapper object being the simplest - of getting a TT/PDS in an OO-passable state. Are you just looking to give access to that TT data to another instance?
>> Something along the lines of a tool that takes a (db or TT) schema and (basically) creates an ActiveRecord representation of it? I don't know whether that (or anything that's close to an ORM) would be the best "ABL way" of approaching strongly-typed data.
Visual Studio has a tool to generate a System.Dataset derived class from a database table schema.
>> What are you trying to do with this object? There are ways - a handle-wrapper object being the simplest - of getting a TT/PDS in an OO-passable state. Are you just looking to give access to that TT data to another instance?
Yes
|
Before Progress spent time building a class from a Dataset would rather they take one of the tools that does mapping from one thing to another in Eclipse and plug that on the front of a tool for mapping JSON (and maybe XML) to a Dataset/Temp-table and then produce a class to convert the data coming in. I say this for the JSON/XML that is too complex for READ-JSON/XML to understand (aka heavy nesting).
JMTC
The DataDigger can do exactly that, only for database tables, not TT's. Check the blog for more info and download option (DataDigger is free and open source). It has some options to generate code. Currently, those are:
There is also an option to add custom export procedures, should you find the need for something that is not yet provided. Detailed instructions are available in DD itself and on the DataDigger wiki.
|