Obj design for best UI use

Obj design for best UI use

Old forum URL: forums.lhotka.net/forums/t/6009.aspx


esteban404 posted on Wednesday, December 17, 2008

I am beginning a new win forms application based on CSLA 3.0.4. One of the objects is a read only base object (Order) that contains 1-many editable objects of type Reel. Each reel can contains 0-many defects.
Order > Reels > ReelDefects

One order can be run on many machines, so the goal is to be able to isolate records in reporting and in the UI. The machine ID is a good filter for this part and it's in the base object and each record reel and Reel defect.

The ReelDefects table is geared toward reports, so it's not a normalized table.

Is there a best way to implement these as objects so the Winforms UI works well? I'm sure there will need to be a timer checking for updates. WCF is not an option as the security #$@!*s have locked down the network and it won't work, so I'm stuck with timers polling for new data.

Thanks,

_E

Curelom replied on Wednesday, December 17, 2008

Could you give a few more details.  What database and version are you using?  Do you have any lattitude on changing the database schema? (I would recommend normalized tables with un-normalized views on top of them for reporting). 

The orders can be run on multiple machines at the same time.  Are users doing different things (different business cases) on the orders, i.e. one guy is working on the order shipping, another on finances, etc.

What have your network guys done to lock down WCF?  WCF can be run through port 80.  If the network allows web services and web applications, you would also be able to do wcf via IIS.

esteban404 replied on Wednesday, December 17, 2008

Curelom:

Could you give a few more details.  What database and version are you using?  Do you have any lattitude on changing the database schema? (I would recommend normalized tables with un-normalized views on top of them for reporting). 


We're using SQL Server 2005. I can change the tables directly related to this application. The users were going to be given access to "something" so they can write their own reports. One guy I report to for this client is OK with good practice and the other is UNIX-trained command-line SOB. Using views was not on the list of OK development options, but I can check further... and will. I think the non-normalized data was for the end user's benefit only.

Curelom:

The orders can be run on multiple machines at the same time.


Are users doing different things (different business cases) on the orders, i.e. one guy is working on the order shipping, another on finances, etc.


In this case, they are doing the same thing. Outside of this process there are no shared responsibilities. Each process uses the same rules and requirements, just different machines to produce a like product. These products need to be traceable to the machine that produced it for capability and containment. The operators are only going to be evaluating their own process, (quality charts, limits, etc.) based on their machine's output, but may need to toggle to a different view of the defects where it's required. In the case of this process, they are only interested in their process and the process's participating machines.

Curelom:

What have your network guys done to lock down WCF?  WCF can be run through port 80.  If the network allows web services and web applications, you would also be able to do wcf via IIS.


It looks like it's related to a firewall in place between the local machines or switches. I tried using one machine to do it all, but outside of the development environment, it simply doesn't work. No errors even in trace logs. It's very odd, and something I'm not really tasked to figure out. I've seen it doesn't work, so I'm not going down that path. It'd be a waste of time. There's also the issue with the framework. I'd have to get permission to install 3.0 or higher and go through a lot of work and headache to enable the machines. Again, something that's more trouble than it's worth right now. We'll have to put WCF on the back burner as an enhancement.

Thanks for your input,
_E

Curelom replied on Wednesday, December 17, 2008

Ouch, it's always a pain when never given enough time to do an application right.

You probably are stuck with a polling solution off of a timer.  You could probably use the timestamp concurrent management to help a little where the poll would check the last timestamp to see if there has been an update.  You could also check with the dirty state of the current objects.  If the user hasn't made any changes, you can probably refresh without the user knowing.  If the object is dirty you could provide the user with some kind of notification such as a messagebox or background color change.  How elaborate the notification would be would depend on how much time you have and the business requirements.  I've done something similar to this and have a timer in the status bar telling the user how old their data is.

If you are running your data portal under local, you might be able to use Sql Server SqlDependency where it notifies of any change to the data of a query.  I've found it to be a bit unreliable though erroring out randomly.  It may be more reliable now with some service packs.

esteban404 replied on Wednesday, December 17, 2008

Thanks, for the input. I have a scenario now where I just store the last DateTime value checked inside the object and include that in the query to only get those records whose created date and modified date are >= that last checked date field. The update of the collections is where I'm struggling to make sure the objects are clean enough to be of use to the UI.

Oh well, I'll figure something out as soon as it bombs. :-\

Copyright (c) Marimer LLC