Embracing a big scary world!

I will be making a proposal at the end of this post, but please read it first!

I started programming in 1991 by teaching myself on a technical level. Starting with Paradox and moving through C++/OWL, Delphi, VB, and most recently, C#, having gotten my MSCD back in 2000.

However, I’ve never had one ounce of college or professional training. As such, I lack a fair amount of logical thinking and decision making.

The biggest result of these two things is that I am usually left with stale code. While technically sound, it would probably make most professionals squeal and fall dead in their tracks. This is one of the primary reasons I have not been employed since 2001.

A lot of people have pointed various things out over time on my current personal project here, and I have listened, though it has taken a lot of effort on my part to hear it. Those with OCD can be very regimented and resistant to change.

I can no longer ignore it. If I want to become better, I really need to heed the advice of those who came before.

As for my proposal…

If I can get at least three regular posters who are familiar with my project to some degree, and have experience using domain driven design, test driven design, and the major thrid-party tools typically used in conjunction with this kind of development, I will restrict any posts on this subject, and my current project, to this thread alone (YAY). I would like those agreeing to occasionally check this thread to see if I have posted an issue or question, and potentially review small pieces of code for correctness.

I genuinely want to learn this stuff, and am willing to listen and put in the work, if you’re willing to forget all my OCD driven rants, and start fresh.

Drew, your resident OCD goofball (Hey…that should be my title here!).

The code will remain where it is until the time I can revisit it. For now, feel free to browse through it. It is incomplete as there is neither a UI nor application services yet.

In case people are wondering, I’ve gone back to college (cited earlier) and my vehicle was just involved in an accident, totalling it. So now, I have to invest my time in trying to come up with transportation.

I am in the process of creating a public repository (svn based) for this, and will post details once it’s all set up.

Drew,

first of all, sorry to hear about your home life, hope all works its self out!

Now for the application, I’ve only had a brief look at it and must say the code and layout is good on face-value.

A few very small things I’d probably do a little differently, though not necessarily wrong.

  1. there are multiple calls to string.IsNullOrEmpty() && !string.IsNullOrWhiteSpace(), create an extension method that does these two things so you can just call something like mystring.ValidateNotNull()
  2. Not sure if threads should simply return a private member variable because NH (or any other ORM) won’t be able to hydrate it
  3. Some items such as Forums do not really require a private member variable, making it public readonly IList<Forum> Forums { get; private set; } will be sufficient, just initialize the List in your constructor. (again, not wrong in it’s implementation, just how I’d do it)
  4. After all the conversations, you seem to have missed the parent forum. If it’s a requirement, put it in there and in your AddForum() method just set the parent.
    forum.Parent = this;
    Forums.Add(forum);
  5. Repository - criteria.Add(Expression.Sql(“ForumId IS NULL”));, again not incorrect, but try to avoid hacking in SQL if you don’t understand NH completely.
    var root = from f in Session.Linq<Forum>() where f.Parent == null select f; (if we implement the parent forum and use Linq)
  6. Test, test, test! I can’t stress this enough. If you want to validate your thinking, write a test. That way you’ll see what’s going to work and what’s not. No need for a DB, just write inmemory tests using SqlLite.

That’s about it after a quick scan. Hope this helps and all the best.

Al

Due to the fact that nobody has responded, and that my home life has taken a dramatic turn, I will be shelving this project. Perhaps indefinately, if things don’t change here at home. It was nice getting to know a lot of you. I wish you all well.

The svn repository is up. For more information, please go here. I have uploaded the base of the solution for now. I’d like to get some feedback on it before I move ahead.

For those interested, the initial domain is up. It’s very basic, and I will probably have to go back and factor in more specialized collection methods as the needs arise. But for now, it’s enough to get started.

Just put up the initial persistence layer for your consideration. =)

Thanks Big Al, things have indeed been rough here, though I still pop in here every couple of days. Allow me to comment on your notes below.

  1. These vill eventually be replaced with specification pattern based validators, which I will add to my infrastructure project once I have a complete list of conditions that I need to test.

  2. The thread entity or the forum entity? Your wording confused me here.

  3. I used IEnumerable as a matter of personal convention. IList would seem to indicate direct manipulation, which it shouldn’t. Using IList would open up sanity holes for other developers who might try forum.Threads.Add(thred). Making it private set would not prevent that, only setting the variable itself.

  4. I’ll take a look when I get home, but I am pretty sure that the Forum entity contains a forums collection. NH handles setting ForumId in the db, so I don’t have to worry about it. Not having a value in that field indicates that it is a root forum.

  5. Related to 4. above, NH handles this via relationship mapping. I don’t need a back reference to parent forum.

  6. This opens can of worms I’d rather not mess with at the moment. I never really “got” unit testing. While I understand the basic precept, deciding what I need to test, how best to test it, and how to read the results are beyond me.

If its any consolation, I went to the link, but its way, way, way over my head. I have a wee bit of ancient rusty ASP but am very much a .NET newbie.

I was hoping to learn something here so I’m sorry to see it go by the wayside.

In any case, do take care of the home front. Priorties!