April 2003 - Posts
I’ve been busy refactoring my event handlers, interfacing model/views and generally patching up my user interface code today. I’ve constructed a fully fledged user interface using docking windows, the nifty Command, Mediator, Factory patterns. The idea is:
The mediator class is supposed to the central application controller. Models register themselves at the mediator as well do the views. The view observes á model, when the model throws an event, the mediator catches it and responds accordingly. For instance figure out what views are currently observing the model which raised the event. Updating the views accordingly.
The cool thing here is that the Command pattern fits in naturally. Command objects have a direct reference towards the mediator, so they “can” manipulate active views directly or call a helper method on the mediator, or even distribute the call over mediator references.
public override void Execute(object sender)
{
// Let the mediator figure out what to do
base._mediator.NewProject();
}
public void NewProject()
{
NewProjectView dlgNewProject = new NewProjectView();
DlgNewProject.ShowDialog();
// Catch results, validation etc
this._project = new Project("A name");
// Register model events
this._project.TraceAdded += new TraceAddedEventHandler(this.OnNewTraceAdded);
// Register view events
((IStatusReporter)this._projectExplorerView).StatusChanged+=new StatusChangedEventHandler(this.OnStatusChanged);
// Initialize our view
this._projectExplorerView.Initialize(this._project);
// Update our view
this._projectExplorerView.Update();
// We can only manage one project at the moment
this._mainView.mnMainMenu.MenuCommands["Project"].Visible = true;
}
Coding monkey!
Borland C# Builder preview (registering required). The more IDE’s the better? I must admit, VS.NET 2002 looks and feels fantastic, but generally lacks because of numerous bugs. I surely hope VS.NET 2003 is presentable as a solid 1.0 release (its predecessor tasted like beta). BUT the thing that got me enthusiastic about Borland’s new yet to be born child is lifetime management!
Using C# Builder, a programmer could take pieces of code written to the J2EE or Common Object Request Broker Architecture (CORBA) model and have that code work within a .Net application.
Read more here.
[edit]
Missed Fabrice
Added direct link to preview
Ok, I’ve got this nasty fever bugging me. Been this way since my first post on gotdotnet. Would my personal health be related to blogging? Sure hope not ;)
Fabrice, there is no good-enough persistence framework for .NET atm. My personal opinion is that they are all lacking. Case closed. Microsoft is propagating DataSets as the way to go, but they seem to forget DataSets aren’t all that, in enterprise solutions at least. For all the Dutch bloggers, read this discussion on tweakers.net.
Does anyone know where I can find a enterprise-based practical sample, preferable written in C# using .NET remoting, WinForms, ADO.NET and a rich set of business operations?
/me goes back to bed
Another day, its about 86F, which is quit exceptional for this time of the year in the Netherlands. Problem of the day: my app takes about 40 Mb business objects only, and I’m expecting the double amount once its hooked to the production database. Sounds like a serious crap app right? Well it’s not! I need to pull my entities from the datastore because my tracing algorithm needs them as input. The homemade mapping framework stores all objects in concrete identity maps. My primary key isn’t factored throughout the database so I’ve created an identity map pro entity.
Solution: Let the app verify the memory addressed and if it hits the magic barrier (configuration issue) it removes just enough objects. The flipside of the story is increasing roundtrips. To somewhat fix this problem we’ll include timestamps. Each object added to the cache (identity map) is stamped and we’ll just remove the oldest object.
I hear you asking, what the hell is he making? A tracking & tracing application for production systems. I’m solving the use cases:
- What the hell is in this dog food anyway? My app can find all batches, batch processes, premixes, storage locations etc
- What did we make with these supplies? My app can find all batches, batch processes, premixes, storage location, distribution, customers who received the finished goods.
I almost forgot, this article provides some solid background information about managing C# objects.
Xipetotecxamanekxochipillixiuhtecuhtlixochiquetzalxolotl says:
Thanks to my schoolmate, Marcel for providing me with that link.
Xipetotecxamanekxochipillixiuhtecuhtlixochiquetzalxolotl says:
Credits due to where it's due.
As you please ;)
Scott is hoping other aggregators will help out in our quest to get some open standard going, his quote posted here:
Hopefully other aggregators will join this "movement".
And I am all for it! Currently me and some fellow college's are awaiting Chris's harvester code drop at gotdotnet. His child is about to be born. So count me in!
Chris's thoughts (copy paster from the message board):
Of course, comment/authoring integration is a nice to have these days... honestly, though, i'de like to see some of the standards settle down a bit.
My response:
I would be happy to include authoring for at least dotnetweblogs. It's just matter of upping the code and let people prototype a'bit.
Can it be done? Simon Fell got some prototyping going on, well worth a look.
"Picking VB.NET over C# is a little like picking which Playboy bunny will join you in the hot tub—you can’t go wrong either way."
[Greg Robinson]
VB.NET is the Anna Nicole Smith of .NET... it used to be very sexy.
[.NET Weblogs]
VB.NET should be banned from this planet ;) As John Lam stated: VB.NET code allocates space for an additional local variable that is never used. Besides C# still has some advantages over VB.NET:
--, <<, >>, *, ., volatile, %=, <<=, >>=, &=, ^=, |= (source MSDN)
Not to mention upcoming stuff like generics. Just a sidenote... we are talking about a shell over bits and bites no?
ScottW asks: Anyone have any links to articles on
caching strategies? (please no how to cache articles).
Repository
Repository
seems to do the job for my mapping framework, give it a try.
I know there is an article discussing caching in .NET somewhere on MSDN, but
I couldn't find it.
[edit]
Here's a great article
you might be interested in:This guide provides information for architects and
developers who are implementing caching mechanisms in their distributed .NET
applications.URL: at
MSDN
Jan Tielens dropped a rather interesting link this afternoon. Building software within a team environment can_and_is a pain in the ass. Mostly because of the fact all developers are linking different versions of dynamic link libraries (DLL’s) MDAC 2.6, MDAC 2.7 on their client machines... or checking in code that doesn’t compile.
So Jan, does the manager sit in front of your top-notch user interface checking for red marks once a build process messes up? I would sign up for a job like that ;)
This certainly looks like a useful tool!
Jimmy Nilsson decided to drop typed collections and go for an ArrayList/HashTable implementation. Jimmy just a note… typed collections are well worth the effort once you’ll start writing business code. I have decided to stop liking persistence tools (give me n:n relations and I'll reconsider) and to stick with LLBLGen. With some help from Fowler I’ll manage until Bill decides to really spank up persistence methodologies in .NET. DataSets or typed DataSets even still feel kind of “relational”. The guys at the MSDN store manage to supply the world with even more questions instead of giving solid answers and demo material. Where the hell are my multi-tiered, custom business entities examples ;)
Department currentDept = findersReg.DepartmentFinder.Find(_departmentId);
foreach(Employee emp in currentDept.Employees)
{
comboBox1.Items.Add(emp.Initials);
}
It’s just one of those days I guess :(
My first post on dotnetweblogs but certainly not my last, thnx Scott!
More Posts