New Posts New Posts RSS Feed: Why does the Object Mapper not also generate a strongly typed DataSet class as well?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Why does the Object Mapper not also generate a strongly typed DataSet class as well?

 Post Reply Post Reply
Author
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Topic: Why does the Object Mapper not also generate a strongly typed DataSet class as well?
    Posted: 16-Jul-2007 at 2:47pm

Depending upon what exactly it is you want that for, you may be able to get what you want already.  PersistenceManager has a DataSet property which returns the DataSet where the persistable parts of entities stored in the cache reside. From that you can generate an XSD (using WriteXmlSchema() if I remember correctly), and some report writers (such as Crystal, I am told) support design-time work against that schema file.

The PersistenceManager only loads the schema for a given type (e.g., Employee) when it needs it (as prior to the first retrieval of entities of that type), or when you call its InitializeSchema() method, telling it the type you want a schema for.   So you could write a small piece of code to instantiate a PersistenceManager, call its InitializeSchema() schema to init the schemas for all the types you’re interested in, and then call WriteXmlSchema() to write out an XSD.  As I remember, .NET (or Visual Studio) also has a utility that will write the strongly typed Dataset class from an XSD.  (I think it’s called XSD.EXE.)

Does any of that address what you’re looking for?

Back to Top
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Posted: 16-Jul-2007 at 2:46pm

This might work.  However, I believe a PersistenceManager does not load DataTables until it actually retrieves data for a matching entity.  So with this approach I believe I would have to load every entity type into the PM before retrieving the DataSet.

 

The more I think about it, the more I see why IdeaBlade probably should not dump out an XSD when it does the ORM mapping.  This would just confuse many developers and might lead to a return to data-centricity, which we are trying to avoid with DevForce.  And of course then you’d lose any custom C#/VB.NET properties you added to the entities classes.

 

What I really want to know is which reporting tool to use.  I’m getting sick of Crystal, and SQL Reports seems to not function well with objects.  I’ve fed it objects, and it works fine with the entity type you pass it, but if you try to get a property of a related entity, it doesn’t work.  I think it is not using property descriptors to retrieve values, but it just getting the “physical” properties of the object.

 

So I guess my other options are ActiveReports and XtraReports.  I was hoping to find a simple way to stick with Crystal for now because it is free and we already have a bunch of developers with a long history of using it (minimal retraining).

 

I’d appreciate your insights into this matter.

 

Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 16-Jul-2007 at 2:45pm
 This might work.  However, I believe a PersistenceManager does not load DataTables until it actually retrieves data for a matching entity. 

The PersistenceManager only loads the schema for a given type (e.g., Employee) when it needs it (as prior to the first retrieval of entities of that type), or when you call its InitializeSchema() method, telling it the type you want a schema for.   

>> 

What I really want to know is which reporting tool to use.  I’m getting sick of Crystal, and SQL Reports seems to not function well with objects.  I’ve fed it objects, and it works fine with the entity type you pass it, but if you try to get a property of a related entity, it doesn’t work.  I think it is not using property descriptors to retrieve values, but it just getting the “physical” properties of the object.

<< 

 

There is a syntax in SQL Reports for referencing  nested properties down to one level (e.g., Customer.CompanyName on an Employee object), but I can’t, unfortunately, remember what it is, and I’ve lost the example where I did it.  I was, however, unable successfully to use a property nested any farther than that.  However, I had a student in class last month who swore you could do it, using just a slight variation of the same syntax I used.  Can’t confirm, but he was very definite about his claim that it worked.

 

>> 

What I really want to know is which reporting tool to use.  I’m getting sick of Crystal, and SQL Reports seems to not function well with objects.  I’ve fed it objects, and it works fine with the entity type you pass it, but if you try to get a property of a related entity, it doesn’t work.  I think it is not using property descriptors to retrieve values, but it just getting the “physical” properties of the object.

 

So I guess my other options are ActiveReports and XtraReports.  I was hoping to find a simple way to stick with Crystal for now because it is free and we already have a bunch of developers with a long history of using it (minimal retraining).

<< 

 

I’ve had students claim that Crystal, also, will now work with business objects – basically ever since the release after .NET 2.0.  On the other hand, if that is supported, I don’t think the support is very good.  I haven’t met anybody who really seems to like Crystal.  Absent good support for objects, you’ll always have the issue with Crystal of having to reproduce the logic for custom properties.  All I know for sure is that (a) you can use it against an in-memory DataSet or DataTable, either of which you can get through the PersistenceManager’s DataSet property; and (b) at least as of a year or so ago, its performance was pretty sluggish when you did so.  I got the impression it was only really good at reporting directly off of a database.  But that was a year ago, and none of these products stand still.  Crystal always seemed to live far from the leading technological edge, though.

 

I haven’t done a *lot* of work with any of the report writers – nobody in IdeaBlade has, actually – but I have done a few simple master-detail reports in XtraReports and found the support for working against objects quite good, including support for deep nesting.  Also, I know we have at least one large customer that uses XtraReports extensively (Ward tells me) and is extremely pleased with it.

 

I did a simple report with ActiveReports once, and found it okay, though nested properties were a little more trouble to work with in ActiveReports than in XtraReports, at the time.  On the other hand, Jay (Traband) said he had looked at the object model for ActiveReports one time and liked what he saw.  He likes to write reports from code, so he kind of looks at things from that viewpoint.  ActiveReports, compared to XtraReports, is expensive, and it’s a much higher profile product for the company that produces it than XtraReports is for Developer Express, so you’d think they must give you *something* good for your investment.

 

In the experiments I’ve done, the support for nested properties seemed to be a key issue; but I also noticed that everybody seemed to be getting gradually better with it, over time, presumably as working with objects becomes more widespread.

 

What’s the take-away from all this?  If I were faced with finding a good report writer to work with DevForce I’d definitely focus my energies on the two you’ve identified, and take the time to learn enough about each to do a report or two that’s representative of the real-world reports I need to create.  Wish I could tell you more, but we don’t have deep expertise in this department.  I’m trying to see if we can do a survey to get feedback from a cross-section of our customers.

 

Back to Top
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Posted: 16-Jul-2007 at 2:44pm

Regarding SQL reporting and nested properties…

“I had a student in class last month who swore you could do it, using just a slight variation of the same syntax I used.  Can’t confirm, but he was very definite about his claim that it worked.”

Any idea who this was and how I can get in contact with him/her? 

Back to Top
IdeaBlade View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 30-May-2007
Location: United States
Posts: 353
Post Options Post Options   Quote IdeaBlade Quote  Post ReplyReply Direct Link To This Post Posted: 16-Jul-2007 at 2:42pm
Sorry, I can't remember.  But like I say, I myself was able to use a property nested to one level in it.  I'm sure you can find the syntax on Google.  All I can remember about what that student told me was that the syntax to do it multiple levels required repeating the keyword you use to do it one level. 
 
I don't have much time until later in the week, but if you haven't found it by Thursday or so, let me know and I'll see if I can.
 
Back to Top
Customer View Drop Down
Senior Member
Senior Member
Avatar
User Submitted Questions to Support

Joined: 30-May-2007
Location: United States
Posts: 260
Post Options Post Options   Quote Customer Quote  Post ReplyReply Direct Link To This Post Posted: 16-Jul-2007 at 2:40pm
Since the object mapper generates a DataTable and DataRow class for each entity, This would enable reporting options that are not currently available (at least not easily). Is this a feature that could be added to DevForce?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down