[Mono-list] Would mono support this kind of application?

Stefan Matthias Aust sma@3plus4.de
Sun, 5 May 2002 11:49:58 +0200


Hi!

To familiarize myself with C#, I'm thinking about creating a wiki/blogger
application using C#.  While I'm working on XP, our servers here run Linux
and I want to keep it that way.  So, using C# for this application does only
make sense to me if I can use mono to eventually host the applicaion on a
Linux box.

I'd like to ask whether mono already supports the features needed.  If you
like, please also make suggestions if I might have forgotten to make use of
some better .NET feature.

On .NET I'm probably suppost to use ASP to create web applications.
Unfortunately I don't know anything about that (JSP and PHP are the only *P
technologies I know) and I don't know whether ASP.NET is supported by mono
yet (would it use Apache as Webserver, similar to Tomcat?).

So I'm thinking about using CGI here.   It seems that I can access the
Environment via

 System.Environment.GetEnvironmenVariable()

and parsing a query string isn't that difficult.  FileUpload would be,
however.  So is there any class from System.Web, I could use?  HttpRequest
and friends all look like there're just for ASP usage.

Actually, I'd love to have something similar to Java Servlets.  ASP ist
probably very similar, but I know Servlet programming very well and a
compatible API would be a big plus.

I think, I'd keep pages as XML files, removing the need for a database.
FileIO and XML processing is part of mono already, isn't it?  Instead of
using XSLT to translate XML data into HTML applications, I think about using
a template macro system similar to jakarta Velocity.  This is probably
something I have to create myself.

A very common feature for wiki servers is that the user need not use HTML.
So I have transform the wiki syntax into HTML. I'd like to make heavy use of
regular expressions here.

BTW, in Java, I'd have used an anonymous inner class to create a regex
replace method, something that enumerates a string and applies some code to
any occurence of a regex.  Ruby has a very similar method.

 String re_replace(String s, String re, IBlock block) {
    // apply re on s and for each match, call block with the match result
    // combine a new string where matches are replaced by the the result
    // of the called block and return that string
 }
 ...
 String s = re_replace("a$A, $B", "(\\$\\w+)", new IBlock() {
   public String call(Match m) {
     return macros.get(m.group(1));
   }
 });

In C#, I don't have anonymous classes (aka poor man's closures).  Am I
suppost to use delegates here?  Or do I have to create a Ruby.NET first?
;-)  (Aside, there's already juch a project, but its documentation is mostly
Japanese)

Thanks,
bye
--
Stefan Matthias Aust   //
www.3plus4software.de // Inter Deum Et Diabolum Semper Musica Est