Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Some MM.NET problems - what approach to take?
Message
De
22/03/2007 22:18:30
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
The Mere Mortals .NET Framework
Titre:
Some MM.NET problems - what approach to take?
Divers
Thread ID:
01207449
Message ID:
01207449
Vues:
84
Hi Kevin & MVPs,

I've got a set of questions that have been marinating around for a few days. Any help you could give on any of these would be most helpful. Most of these apply to a Windows Forms environment, since that's what I'm currently struggling with.

Some of these would be very useful examples in the developer's guide, and although I have an inkling about how some of them might be done, I'm going to pretend I don't just to see what your answer might be <g>. I'm a C# veteran but MM.NET rookie, so I could well miss a few things.

The sample application is really very simple and only show a couple of ways to do things. Some of these are due to the simplicity of the underlying Northwind database of course. For example, all the maintenance is based around the design of List and Properties tab. What if you wanted separate List and Edit forms? (mmButtonNew isn't useful here for example, since). (You don't need to answer this for my benefit, but keep reading...)

This leads to the big question - how would you go about implementing an MVC framework where, for example, there are two or more forms sharing the same business objects (or otherwise copy of data). Failing the perfect implementation of this, how might one form communicate to another that its copy of data is out of date and needs to be refreshed? (In VFP where there was the same issue with two forms having private datasessions, we used to implement a kind of "Broadcast Data-Needs-Refreshing message" which told a form to requery, but having the forms work off the same model would be better).

It sounds like next version of MM.NET should cover my current gripe about making user controls with their own business logic (see messages in this forum earlier this week. Must be my proximity to Australia that I wanted this too <g>)

The BindingSource properties of Windows form controls refer to Entity names, so what happens if you need to have two business objects managing the same entity (for example, two lists, one "Links to" and the other "Links from", both lists of Link entities, with different current rows)

Finally, I'll just mention a couple of advanced topics that might be worth exploring. I might consider these more important to solve in a few weeks's time <g>

1. Entities involving a subcategory relation

eg Party - o||-- Customer and Party --o||-- Supplier. I haven't tried this out on the Business Layer generator yet but I suspect it would only cope with a view. At the business object level, I'd want Customer to inherit from Party, CustomerEntity to inherit from PartyEntity etc.

2. Lookup values in related tables in a data grid view or on a form. Basically, like readonly comboboxes without displaying the "arrow down" button. As far as I can tell, I've only seen this done (in .NET) by binding the grid to a view or other manufactured data table (It's an awful lot easier just to use a readonly combobox!). (Ironically, in VFP that's usually how I did it too, despite the existance of relations, but even there it requires code to look up IDs).

Thanks guys, sorry for the big message
Walter

P.S. Another one I thought about, although I'm not sure if I'll use it in my current project, it would make a good topic for the help. If I wanted menu items File : Save, File :Revert (message sent to currently active window) what would be the way to handle this? ie..

private void SaveMenuItem_Click(object sender, EventArgs e)
{
mmBusinessForm oForm = mmAppDesktop.FormMgr.GetActiveBusinessForm();
if( null != oForm ) oForm.Save(); // or Revert, check IsChanged etc.
}

And probably handle the File menu's DropDownOpening event to enable or disable Save/Revert based on GetActiveBusinessForm().IsChanged()

When I've got a bit more MM.NET experience under my belt, I could write this article myself. Or blog about it.


P.P.S.
One other thing. The "Binding Source Selection" dialog (got from [...] button on BindingSource in the property sheet) only recognises this syntax:

this.oXYZ = (XyzBizClass)RegisterBizObj(new XyzBizClass());

and not the

RegisterBizObj(oXYZ = new XyzBizClass());

Could there perhaps be a way of defining available business objects using an attribute or something? The current implementation (scanning code) strikes me as a bit fragile.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform