

The FogBugz Plugin Architecture - df07
http://www.fogcreek.com/FogBugz/blog/post/The-FogBugz-Plugin-Architecture.aspx

======
profquail
Instead of having your plugins be able to execute SQL commands, why not use
something like ActiveRecord + NHibernate (or some other ORM) with LINQ?
NHibernate 2.1 was just released with LINQ support, so you could do something
like:

int BugCount = Bug.Where(case => case.Id = caseId).Count();

(Where caseId is a parameter or something). It'd really simplify the API and
keep you from doing safety checks on the SQL passed by the plugins. You might
even be able to simply some of your "display" code to use Dynamic LINQ queries
for the sorting and so forth.

I've been using the ASP.NET MVC + NHibernate + ActiveRecord + LINQ "stack" for
several months now (though I've been an ASP.NET developer for about five
years), and I have to say that my productivity has gone way up thanks to it.

~~~
gecko
FogBugz targets .NET 2, which lacks .NET Expressions; they'd have had to build
their own AST model, without C# support. I wouldn't be surprised if, whenever
FogBugz gets around to requiring .NET 3.5, they start supporting LINQ queries
against the exposed datasets, but I wouldn't hold your breath.

~~~
profquail
Oh, that's too bad. I'm thinking about writing a plugin for FogBugz, and that
would have been nice to have (it won't stop me from writing it though ;)

Perhaps they could check out LINQbridge
(<http://code.google.com/p/linqbridge/>). I don't know if that could be
adapted to work for them and ease the transition to .NET 3.5, but perhaps its
something to look at. (It _almost_ replicates LINQ on the 2.0 framework.)

------
ajg1977
FogCreek still prefix their classes with 'C'? Oh Joel... :(

~~~
listic
Please explain for the dummies: is this sort of naming convention just a fad
that is out of style or has some of the latest advances in technology made it
obsolete?

~~~
cdr
Ignore the Hungarian haters.

Joel's stance on Hungarian notation is laid out here:
<http://www.joelonsoftware.com/articles/Wrong.html>

~~~
ankp
_Ignore the Hungarian haters._

Which would be basically everyone who didn't learn to write software on
Windows.

If you have a reasonable type system and language, leverage it to enforce
semantics that Spolsky suggests you use Hungarian notation to imply by
convention.

You'll be much less likely to be castigated by the individual who has to
maintain your code after you. Microsoft has put Hungarian notation to rest,
nobody else o speak of uses it, and you shouldn't either.

~~~
cdr
The type of Hungarian notation Spolsky uses at Fog Creek is different than the
Hungarian once pushed by Microsoft. He goes over that in the linked article.
I'm not defending it - I've never tried it - but it obviously works for Joel.

Also, if you're working at Fog Creek, the guy who has to maintain your code
after you will also be using Hungarian.

~~~
ankp
_The type of Hungarian notation Spolsky uses at Fog Creek is different than
the Hungarian once pushed by Microsoft._

Hungarian notiation (of any variety) started (and ended) at Microsoft.

 _Also, if you're working at Fog Creek, the guy who has to maintain your code
after you will also be using Hungarian._

If you're working at Fog Creek you're writing code in a custom in-house
programming language as well as using Hungarian notation. I don't think the
example is generally useful or applicable to anyone else.

------
kristiandupont
I wonder if they will let people charge for their plugins and create a plugin
store rather than a gallery..

~~~
df07
It is planned, but not implemented yet. We're also still gauging interest.

<https://developers.fogbugz.com/default.asp?W133>

