SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)

    Unhappy Are there any alternatives?

    Other than PHP and ASP.NET, are there any alternatives that lay somwhere in between the two? I find I can't work completely within one or the other for various reasons. Like .net's type-safety and namespaces, as well as a lot of the built in objects and collections, but I don't like the overhead or the rediculous amount of passing around of some things like httpcontexts as such, just to expose MapPath and other similar things down through the levels of objects I might have. There doesn't seem to be a Global space to declare variables that all objects will have scope to. I also dislike how singletons are rendered useless in .net web apps, as that's the only other way I can see to persist something between objects without passing the actual object around. So unless you guys konw of some alternative for me, I guess I'm finally hanging it up. I'm out. Tired, overworked, and too lazy to write any more code than I really need.

  2. #2
    SitePoint Author silver trophybronze trophy
    wwb_99's Avatar
    Join Date
    May 2003
    Location
    Washington, DC
    Posts
    10,623
    Mentioned
    4 Post(s)
    Tagged
    0 Thread(s)
    Actually, HttpContext is a singleton as well (HttpContext.Current). Not that addressing singletons is a generally good idea. How are you creating your singletons? Moreover, what is wrong with passing objects around?

    Or, it sounds like there are flaws in your design that are making alot of these things hard.

  3. #3
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sounds like you need you are hitting a wall that only Dependency Injection/Inversion of Control will help you scale. I would highly recommend you start researching both, and look into some containers in the .NET space. There are a few:

    Castle Windsor (http://www.castleproject.org/container/index.html) - I use this
    StructureMap (http://structuremap.sourceforge.net/Default.htm) - Wyatt uses this
    Ninject (http://ninject.org/) - Never used the the founder is a smart guy

    Also, if you are wanting to use on the those IoC containers with Asp.Net, then checkout MvcContrib (http://www.codeplex.com/MVCContrib). MvcContrib supplies all the plumbing for hooking up and IoC container with Mvc, and so much more

  4. #4
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    Well, to wwb, I'm actually -not- using singletons in the .net web app because of the fact that they aren't thread safe. And problems? Yeah, I have a ton of problems, but I'm failry certain they lay more within me, than my design. Mostly because my design is incomplete. I lack the ability to make certain decisions on things. A small and partial list of such things might include...

    Do I use routes like: /Admin/ManageCategories, /Admin/Categories/Manage, /Category/Manager, or...GAH!!

    Do I use resx files for my strings, store them in the database, or in xml files kept in the App_Data folder (so users without VS-IDE can author and donate translations)

    Do I use Dictionary(of string, string) directly in certain places, or make a new class like 'public class TempCache : inherits from Dictionary(of string, string)' even though I add no new functionality, just so it's easier to write?

    How many parameters are considered too many for an object constructor? Etc..etc...

    The list goes on.

    ----------

    To dhtmlgod, I'm already becomming overwhelmed with the sheer number of classes I've had to write and slot together just to get done what little I've gotten done. When I think about adding more, I shudder, even if they'd be helpful. Don't you ever stare at a project tree, onceit reaches the point where just the folder list extends beyond the bottom of the IDE and go "screw it..." this isn't worth it?

    I have issues with making decisions and patience. I need something quicker.

  5. #5
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Our projects are full of small 20-40 lines classes that do only one thing. We use an IoC container to hook everything together and compose things exactly how we like nad need them. When I look at them all, the first thing I think is I know exactly what that class does, it's name tells me (lets say BrokerWithUnsubmittedClientsInTheLastHourReport), and I can quickly get to it from anywhere by pressing ctrl+t and typing BWUCITLHR (R# is your friend).

    However, you do have a point, Mvc requires alot of investment to get it to a level where you can be quickly producing features and business value. We have been using it for over a year, so we have everything in place, and wouldn't like to start from scratch. Maybe .NET and C# aren't the best tools for you. If your looking to get something up quickly and with a little flexibility, then maybe Ruby on Rails or some PHP based Mvc framework might prove more valuable, or maybe you just need more "RAD" support and classic WebForms might be worth a look.

    Not that I'm trying to say you should ditch .Net or that RoR/PHP are better, just that you need to pick the right tools for the job. I write enterprise stuff, that interops. with other systems, 3rd parties, etc. so I prefer .Net. In a different position, maybe a design shop or marketing agency I would opt for RoR as the required sites are generally simpler and content/marketing heavy.

  6. #6
    Resident OCD goofball! bronze trophy Serenarules's Avatar
    Join Date
    Dec 2002
    Posts
    1,911
    Mentioned
    26 Post(s)
    Tagged
    0 Thread(s)
    To be honest, I'm not sure where I stand at the moment. I have currently turned off IIS.

    At one point, I had two machines. One was my Vista gaming / workstation. The other was a FreeBSD / Apache / PHP / MySQL machine. The second one got fried due to a storm. With my demand for a visual environment and only one PC left, I got Windows Web Server 2008, and decided to try IIS / .NET / SQLEXPRESS because of the native code. I considered a WAMP approach, and am highly thinking of returning to it.

    My application needs are quite small actually, probably not something that really needs MVC and that might be one of my issues. There are ten tables in the database:

    Categories
    Favorites
    Forums
    Groups
    Masks
    Moderators
    Posts
    Subscriptions
    Threads
    Users

    It uses NO javascript and NO AJAX in any of the html. The post form, for example, is a simple textarea! All html, sql, and tags are explicitly stripped. The only thing left area a few bbcodes.

    The part where the issues come in is in how I store the html and the localized output strings.

    The reside in a folder structure like this:

    locales/en-US.xml
    locales/en-US/global.xml
    locales/en-US/errors.xml
    locales/en-US/index.xml

    skins/default.xml
    skins/default/shells.xml
    skins/default/index.xml

    They are read into collections / dictionaries based on the global default, and overriden by user.

    So maybe I'm thinking PHP is a better solution for me after all.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •