AwBus Update

I didn’t have a lot of time to work on it this week. But, I made some good progress tonight.

The broker service is the middle-man between the nodes. Nodes are stand alone and don’t need a broker, but if you want them to play together, that’s where the broker comes in.

When I last worked on this, the nodes register with the broker on startup. But, the gui only showed Node1. Now, it works properly. The broker window calls the broker service. The broker service responds with the list of registered nodes and their endpoint information. When you double-click a node, it opens the node admin for that particular node (rather than the previously hard coded node 1.)

The broker will also server as a common entry point for all nodes. So, you will be able to adminster any node without that node exposing any public endpoints. That’ll allow you to reduce the number of endpoints and security setup, etc. But, that doesn’t exist yet.

The screen shot shows 4 programs:

  1. Start the broker
  2. Start node 1
  3. Start node 2
  4. Start the admin program

The admin program shows that Node 1 and Node 2 are open.

image

NEXT: Both nodes are loading the same containers by default. The container store is node specific, I’m just not using it that way yet. For my next post, they should each have their own containers.

Vs 2010 in Windows 7 VM

I had a rude awakening today. Running VS2010 Beta 1 in a WIINDOWS 7 VM on a WINDOWS 7 HOST is not good. It worked 100% fine when the host was windows xp 32 bit, but on Windows 7 64bit… its not even functional. That’s unfortunate.

My Experience with Windows Forms

I’m not good with GUIS, nor do I aspire to correct that. There are plenty of things for me to code; I can leave the presentation to someone else. They can make it pretty.

But, I need to be proficient, and I am. I can’t make it pretty, but I can make it work. When I started AwBus, I considered using WPF. But, that would’ve been a brand new thing to learn and I’d rather focus my time on the back end. The front is very important because that’s the only way to demonstrate its abilities. I can do that with plain old windows forms.

Tree View

I’m not sure how you’re supposed to keep track of things in the Tree View. For example: in the nodes window, I’m displaying the node names. But, when you double click it, you need a ton of other info. Essentially, it needs the entire registration object that came back from the service call.

So, I created an awkwardly named class called “NodeTreeNode”. The first node pertains to the AwBus. TreeNode pertains to the Tree View. The NodeTreeNode object has a property that holds onto the registration object. Then, its just

treeViewBroker.Nodes.Add(new NodeTreeNode { Blah = blah});

I used BLAH because I’m too lazy to look at the actual property name.

I was also surprised to see that nodes don’t have double-click event; you can only get it from the tree. When the even fires, I look at TreeView.SelectedNode and see what the type is. Then, it branches base don type. Currently, there’s only one custom node type in the broker admin, but you see in the Node Admin there will be a lot of them.

Form Management

I spent more time on the GUI then on the backend. I created a Form Manager to keep track of which forms are open, etc. So, if you double click NODE 1 two times, it doesn’t open it two times.

I saw something like this once before at an undisclosed location. The problem with that implementation is that it works as follows:

  1. Instantiate the form
  2. See if the form (plus key info) is already in the list of known forms
  3. If so, close the form

Instantiating the form to see if you need the form isn’t the best approach. I attempted to correct that implementation by adding a static method to the forms that constructs a key based on input criteria. It wasn’t ideal, but it was the best I could do with what I had to work with. I don’t know if those who came after me kept up that pattern.

The form manager in AWBus is cleaner. You pass it: The Form Type, the Key, and a list of any constructor parameters that you want to pass the form should it need to be instantiated.

In the case of the node admin form:

Type = typeof(NodeAdminForm)

Key = Node 1 (the name of the node; the uniqueness)

Parameters = The endpoint object stored on the tree

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: