Java counterpart of ASP.NET data access tutorials - c#

I am relatively new in Java technologies. I want to know the best frameworks and which to consider when I am making a similar web application just like in the ASP.NET Data Access Tutorials. My backend is MySQL. And my criteria from being 'similar' is ease of use and application extensibility and maintainability.

You might also want to take a look at Hibernate.

Look for "JPA" (Java Persistence API). There are lots of tutorials, especially when you try to add a UI to your app. JPA itself is explained here.
[EDIT] As Fredrik Wallenius pointed out: Try this tutorial.

Related

Is IStringLocalizer meant just for ASP.NET?

I stumbled across the entire Microsoft Localization Extensions section the other day. IStringLocalizer/ILocalizedString, all that.
I've already got a hand-rolled approach to localization in my current app (.NET 6, WPF, Prism), but I would gladly convert over to this if appropriate; Because it's much easier for a new developer coming on a project to understand something when there are reams of standard MS documentation about it rather than trying to guess what I had in mind.
But virtually every discussion or example of IStringLocalizer that I can find seems to relates to ASP.NET or at least web apps. The docs all seem to assume you're writing ASP.NET.
So are these extensions meant just for ASP.NET and web apps? Is anyone using this approach outside of web apps? And if so can anyone point me to any examples?
-Joe
No, as by docs (2021):
In this article, you will learn how to use the IStringLocalizer and IStringLocalizerFactory implementations. All of the example source code in this article relies on the Microsoft.Extensions.Localization and Microsoft.Extensions.Hosting NuGet packages. For more information on hosting, see .NET Generic Host.
There is no mention of being asp.net specific, although, asp.net applications obviously tend to make use of it as well.
The examples do not use asp.net.
I've used the resx file approach in the early days a lot in WPF applications - although slightly different, I see no reason why it wouldn't work in any regular application.

Which web application technology should I use for graphs?

I'd like to create a webapplication that allows users to work with graphs. (Retrieve data related to nodes, create new ones, drag them, etc.) I thought it would be a good idea to store the data in a graph database (e.g. neo4j) and display it with some JS-Frameworks (e.g. http://cytoscape.github.io/cytoscape.js/).
Currently I'm not sure which web application technology I should use. Since one requirement is to use microsoft technologies wherever possible I thought it might be a good idea to go with ASP.NET in C#. However, during the first chapter of my ASP.NET book the following is mentioned:
it’s worth noting that ASP.NET is not the best platform for writing
complex, app-like client-side programs
So, which technology should I use to create my web application? Any recommendations?
Well,
from my experience, I think one of the JVM based languages like Java is a save bet, if not the most sexy one. And it works best with Neo4j, and Java 8 is really nice syntax-wise.
For JS-based frameworks, try Node.js and the Neo4j REST API, should work good, too.

C# and WCF , where to learn about it?

Its been a few weeks since I started learning C#, i know my way around visual studio, know things about classes, constructors, objects, played around with WPF and now think its time to learn some networking, say making a simple server/client application.
From what I understand winsockets are outdated and currently it is better to learn WCF ?
Maybe someone know some books, articles or tutorials about WCF for beginners where it would be explained step by stem from the ground up. :) Since all I was able to find were either rather complicated materials assuming that the reader it already a master-programmer or just coded supposed to be used as copy/paste without really explaining what it does.
Thanks! :)
In short, WCF is Microsoft's library of code to simplify the process of inter-machine and inter-process communication. Pre-WCF, there were a number of frameworks you could use. WCF gives them a consistent .net interface to simplify programming.
I recommend "Learning WCF", by Michele Leroux Bustamante. It's as thick as a Bible, but it has accessible material about the different facets of WCF with lots of code samples.
http://msdn.microsoft.com/en-us/netframework/wcf-screencasts.aspx
A very accessable group of tutorials, that cover the basics very well. Great place to start.
I would like to reccomend Pro WCF: Practical Microsoft SOA Implementation
- i've been learning with wcf with it.
I learned what I needed to know from the book Windows Communication Foundation Unleashed by Craig McMurty, Marc Mercuri, Nigel Watling and Matt Winkler. It has good examples that you can use to produce your own web services and such. It requires some knowledge of C#, which you seem to already have.
Go to MSDN my friend,If you have the patience to read the tutorials/articles in MSDN you can learn WCF very well.
Here are some good beginner tutorials from MSDN
http://msdn.microsoft.com/en-us/library/ms735119(VS.90).aspx

Are there alternatives to ASP.NET for C# web development?

Lately, I've been thinking that I'd like to try some new ideas and a new approach to web application design. I'm mostly used to using ASP.NET (.NET 2.0) but I've toyed with the ASP.NET MVC library a little bit as well. While both are powerful and interesting, I'd really like something more... basic.
Is there anything like that out there? I'd like a framework that's more transparent really: I want to be able to see the request, pass it where I want, render HTML the way I want, and post requests how I want. I can get all that in ASP.NET, but I have to dig pretty hard to get at all of it. I'd like something simpler to use as the basis for some new framework ideas.
So is there something like that out there? Or would I pretty much have to completely reinvent all the basic routing, request, and response code as well to get a platform to build up from?
I'm not sure if it fits your requirements, but you could definitely check out Manos
It's not answering the question but I really strongly think you're making a mistake here.
MVC lets you deal with rendering in the way you want (it's not like the bad old webforms), HttpHandlers let you deal with Requests and Responses as low down as makes reasonable sense (to me). 99 times out of 100 you don't want to have to deal with the raw raw data coming from the web server (and what is raw anyway? "Request" is an abstraction itself...).
I think you have to look long and hard at your motivation and consider the practical costs if you could get there.
You should look at Fubu MVC then FubuMVC
I would say if you are set on C# as your language ASP.net MVC is as good as it gets right now. You may want to experiment with other template engines like Spark or Nhamle.
I would go and implement an HTTP handler using ASHX files. It gives all the power of ASP.NET object model but do not limit you on any special way of handling the request.
If you are looking for alternate frameworks you might want to have a look at Nina
https://github.com/jondot/nina
From the website:
Nina is a web microframework for the .Net platform, inspired by Sinatra. It includes several aspects that go futher beyond Sinatra, such as an abstract, pluggable, and extensible infrastructure.
A simple to use DSL, a simple programming model.
Performance as a goal.
Multiple pluggable view engines.
Many scenarios covered by Json and XML serialization support.
Advanced cache-control for a RESTful ecosystem; automatic ETagging and Last-Modified controls.
Nina is intentionally build against the .Net 2.0 runtime in order to afford a lower barrier of entry!. A port of Nina for the 4.0 runtime will be available shortly.
Razor support note: I chose to use RazorEngine, which is an open-source abstraction of a Razor view engine without using the full MVC stack. In that implementation, view data is exposed as 'Model'. I chose to align other views and now each view has its view data accessible by 'Model' and 'ViewData' members (except Razor).
I think you want the WebMatrix.
It's basicly a very simple (ASP like) model, but then coded with C# / .Net, and you get the #Razor syntax.
Although this is a relatively old question, I would like to add some other frameworks that are worth a look:
MonoRail is older than Asp.NET MVC and very similar to it. They are currently working on Version 3 of MonoRail. I used MonoRail Version 2 for a side project and it was a nice experience.
OpenRasta. I have no experience with this right now.
TinyWeb. An excellent Asp.NET Micro Framework (You may find the comparison of .NET Microframeworks interesting (including the Anna and Jessica web frameworks))
There is the ASP.net Model View Presenter which may be something like what you are looking for.
http://www.codeproject.com/KB/architecture/ModelViewPresenter.aspx
It sounds to me like you're looking for a microframework like Sinatra , but in c# instead of Ruby. I am not aware of any such framework.
I recommend you dive into Sinatra itself. Learning Ruby will help expand you as a developer, you'll be closer to the HTTP metal (which sounds like what you want), and it'll be fun. The minimalism and simplicity that it sounds like you're looking for is much more popular in the Ruby community.
If you can use mono. Then you can try Mongrel2 with dot net bindings. It is very fast language agnostic web server. It works via zeroMQ.

Lightweight .NET web development?

I'm currently working on a project that has a sizable amount of both client and web code. The client code is written in C# and the web piece is written in PHP. Maintaining consistency between the two worlds is becoming cumbersome, and I want to consolidate the web code to .Net.
The issue is that I hate web development in ASP.Net Web Forms. I want something as raw as PHP, just using C# instead. I've read a little about ASP.Net MVC, but it looks like it abstracts too much of the request logic for my liking.
Does anyone know of a lightweight way to allow C# + .Net to handle web requests? Should I be looking more closely at MVC?
Update: I went with ASP.Net MVC and I've been very pleased so far.
If you're looking to get away from ASP.NET Web Forms, the I recommend ASP.NET MVC with a custom view engine (like Spark, or NHaml). This will give you the consolidation your looking for and allow you to avoid most of the Web Forms that your not happy with.
AFAIK, to do .NET web development, you are going to have to interact with ASP.NET in some form or another, but the custom view engines in MVC could be exactly the abstraction your looking for.
It is now possible to use a software stack completely separate to IIS and ASP.Net using Kyak, Nancy and Gate.
http://bvanderveen.com/a/gate-0.1.0/
You might want to check out Kayak, which is, to my knowledge, the only standalone .NET web development framework that's not ASP.NET.
Caveat: Kayak's request handling implementation is not the best, so there may be performance or scaling issues. I can't say for sure -- I've only read it, not run it.
Edit: I've taken another look at the source code, and it looks like they've rewritten a significant portion of their server code, and in doing so fixed the major issues. Performance probably won't be a problem.
MVC.NET is open source, so you can make it do what you want. It is a framework that is overrideable, extensible, etc. I'd look closer at it. It works great for me and I've come from a background of CGI, Struts and Webwork. I love it.
In my opinion nothing is more lightweight than the combination of NancyFX (http://nancyfx.org/) with Dapper (https://github.com/SamSaffron/dapper-dot-net) for data access.
NancyFX can be hosted within ASP.NET, WCF, Azure, OWIN-compatible environments, Umbraco or you can write your own host.
Read also these articles:
http://theothersideofcode.com/lightweight-development-in-dot-net-nancy
http://theothersideofcode.com/lightweight-data-access-in-dot-net-massive
I also suggest you to TinyIoC (https://github.com/grumpydev/TinyIoC) for decouple your application layers.
Regards,
Giacomo
You should look into the IHttpHandler and IHttpModule interfaces. These are the foundations for ASP.NET WebForms. Brad Wilson has a good intro to the former.
In the bad days when WebForms was the way to do ASP.NET development I was writing my own simple MVC framework with these interfaces. The bit I struggled with at the time was the View engine but now there are a number of these.
You take a closer look at ASP.NET MVC since the source is available and decide for yourself. It may be that you want to change some of the conventions used rather than the whole framework.

Categories