Fog Creek Software
Discussion Board




Script Editor Design Question

Each script can have one or many connections to a database.  You can give a connection a name like "MyConnection".

The editor allows you to have a group of scripts open at the same time because you can link between scripts.

There is a script explorer and a database explorer.  I made two seperate explorers so that I could consolidate connections to a single database and keep the script explorer un-cluttered.  Therefore if one open script uses a database with ConnectionString="dsn=DBSvr" and another open script also uses a database with the same string only one connection will show up in the db explorer.

The problem is naming of connections.  If ScriptA uses ConnectionA but names it MyConnectionA and ScriptB uses ConnectionA but names it MyConnectionB, how should it show up in the DB Explorer?

Another approach is to just pool the connection in the background and actually display the MyConnectionA and MyConnectionB to the user (even though they both have the same connection string).

The the problem becomes Script ownership.  What if ScriptA has MyConnectionA and ScriptB has MyConnectionA but ScriptA.MyConnectionA.ConnectionString=X and ScriptB.MyConnectionA.ConnectionString=Y?

This is supposed to be a dummed down version of a form designer for non-programmer types to use.  Any thoughts?

Wayne
Thursday, August 21, 2003

> Another approach is to just pool the connection in the background and actually display the MyConnectionA and MyConnectionB to the user (even though they both have the same connection string).

Yes, that sounds more intuitive.

> The the problem becomes Script ownership.  What if ScriptA has MyConnectionA and ScriptB has MyConnectionA but ScriptA.MyConnectionA.ConnectionString=X and ScriptB.MyConnectionA.ConnectionString=Y?

How is this a problem?  These are different objects, right?  If they aren't, is there a reason you need to share them?  Is this premature optimization, so to speak?

Scot
Friday, August 22, 2003

Is it vbscripts (lack of) scoping that is  biting you?

Use vb.Net as a scripting lan ie option explixit and strict off is old vbscript compatible but you gain the scoping

Karel
Friday, August 22, 2003

>These are different objects, right?

Yes, they are different objects.  I think I mis-stated the question.  Really it's a GUI design question.  For instance here is the script explorer window:

--------------------------
-Script1
    |--MyConnection

-Script2
  |--MyConnection
--------------------------

Here is the seperate database explorer window:

--------------------------
-MyConnection
  |+-Catalogs
  |+-Tables

-MyConnection
  |+-Catalogs
  |+-Tables
--------------------------

In this case, there are two scripts open, each with a connection named MyConnection.  in reality the Script objects have more than just connections in them (they have Pages, Datasets, Functions, etc.) which is why the database explorer is a seperate window because the hierarchy would get too big too quickly.

I'm thinking of synchronizing the trees so that you only see connections in the database explorer that apply to the currently active script.

I also don't want to combine the explorers because they each have different, complex sets of data to display.  I think it's enough that you can snap the windows together and to the sides of the app like VS.Net tool windows.

Wayne
Friday, August 22, 2003

In the db window, prepend the name of the "owning" script... or in some other way provide context.

Scot
Friday, August 22, 2003

Not a bad idea (prepending the script name).  That is much simpler to implement than synchronizing views. 

I am trying to think of other ways of showing context but between your idea and hiding/disabling invalid connections I can't come up with any.

I'm going to sleep on it, thanks for your help.

Wayne
Friday, August 22, 2003

Sure!  And you get the credit for asking in the first place.  It is hard to make things simpler.

Scot
Friday, August 22, 2003

*  Recent Topics

*  Fog Creek Home