473,748 Members | 9,641 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Swing vs. WinForms

Hi folks,

I'm a Java programmer and now I have to use C# for a new large
project. The language is the best I've ever seen. In some points it
goes far beyond Java. I like that.

But then there was a great dissappointment s about WinForms. Compared
with Java/Swing (skip the performance, I mean the development) it is
very poor at first sight. It reminds me when I startet in 1995 with
Delphi (guess a guy named Heilsberg is the reason :wink: ). Is it
true there is no MVC concept in WinForms? Is there any way (or third
party lib) to use a MVC pattern with WinForms?

Best regards,
Frank.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com
Nov 16 '05 #1
2 7362
Frank,

There is nothing in the framework that supports this out of the box.
However, that doesn't mean that you can't implement it yourself.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"frank_ulbricht " <fr************ @gmx-dot-de.no-spam.invalid> wrote in
message news:40******** **@Usenet.com.. .
Hi folks,

I'm a Java programmer and now I have to use C# for a new large
project. The language is the best I've ever seen. In some points it
goes far beyond Java. I like that.

But then there was a great dissappointment s about WinForms. Compared
with Java/Swing (skip the performance, I mean the development) it is
very poor at first sight. It reminds me when I startet in 1995 with
Delphi (guess a guy named Heilsberg is the reason :wink: ). Is it
true there is no MVC concept in WinForms? Is there any way (or third
party lib) to use a MVC pattern with WinForms?

Best regards,
Frank.
Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------
http://www.usenet.com

Nov 16 '05 #2
frank_ulbricht wrote:
Hi folks,

I'm a Java programmer and now I have to use C# for a new large
project. The language is the best I've ever seen. In some points it
goes far beyond Java. I like that.

But then there was a great dissappointment s about WinForms. Compared
with Java/Swing (skip the performance, I mean the development) it is
very poor at first sight. It reminds me when I startet in 1995 with
Delphi (guess a guy named Heilsberg is the reason :wink: ). Is it
true there is no MVC concept in WinForms? Is there any way (or third
party lib) to use a MVC pattern with WinForms?


Sure you can (and should) do MVC in Windows Forms. Unfortunately, there's
little to no documentation on this topic, and all (Windows Forms) books I
know fail in this area as well. So here's my recipe for using MVC in Windows
Forms (just a whirlwind tour, not a methodology ;->):

1. Write the application model. Do not tie it in any way to the UI layer by
having dependencies to it. Test the heck out of it using NUnit, csUnit, etc.

2. Expose all relevant properties of the model and add events for each
property change that needs to be communicated to the UI layer. This can be
done at any level of granularity, from a single ModelChanged event to one
event per property.

3. Design the UI.

4. Implement the UI's event handlers so they update the model's properties
as required.

5. Implement model event handlers in the UI classes that update the UI on
model updates.

As you might realize, .NET events and delegates actually make it easier (or
nicer) to implement MVC. What you're still missing are the default models
that come with Swing for each type of control, but I doubt their value
anyway, because having a model per control is hardly desirable -- the model
should reflect the problem domain in terms of the domain.

Note that there's also a MVC framework for Windows Forms and ASP.NET: The
User Interface Process Block at
http://msdn.microsoft.com/library/de...html/uipab.asp.

Cheers,

--
Joerg Jooss
jo*********@gmx .net

Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1971
by: Scott Khan | last post by:
We have a Java Swing position. Need consultants ASAP. Position : Java Swing XML / SOAP - FX / Brokerage Requirements : Swing - JTrees / Jtables. other swing classes. etc. Java/ J2EE. JDK 1.2-1.4 XML / XSL/ XSLT Duration : 6+ months
5
13966
by: Chris | last post by:
Having been traumatised many years ago when using MFC/C++ to develop front-end code, I've religiously avoided GUI work since and stuck to back-end / server-side projects. So I'm a bit of a novice when it comes to designing Swing-based applications. I'm now having to do more and more GUI work to support my current projects, so I started looking for tutorial / best-practices materials on the net. I was somewhat surprised to find that...
6
6420
by: Joseph | last post by:
hi 1) i plan on having an awt canvas component (to draw graphs) on a JFrame with other swing components..will this be okay? i've read that swing and awt aren't compatible.. 2)Also, if i have a function which simply loops infinately that is part of a form, what happens when a form event (eg button click) occurs? will the event handler be executed simulatanesouly with the loop? or does the event excecute first and then the loop is...
3
3462
by: bergel | last post by:
Hello, Does anyone already have some experience in mixing AWT and Swing? Is it conceptually doable? Does the design of Swing prevent interaction between an AWT and a Swing widget? Regards, Alexandre
3
4863
by: Sherrod Faulks | last post by:
I'm using Jython and in the python script I do: from javax import swing result = javax.swing.JOptionPane.showInputDialog(wC, cmd,"Prompt from " + client.serverName, JOptionPane.PLAIN_MESSAGE) wC is a JFrame, cmd is a String and client.serverName is a String. It won't show the JOptionPane, why?
1
2240
by: Nandan | last post by:
hello, can I ask a jython question here? when I use the jython interpreter I have no problem with the statement: from java import lang from javax import swing but when I put this in a script, I get a package not found error. what am I doing wrong?
2
2051
by: asj | last post by:
I have to honestly say I was flabbergasted by this report. Obviously, I have no problems asserting that Java is #1 in the enterprise (JEE), or in the mobile space (JME), and I do know it's made good strides on the desktop, with popular apps like Azureus, Limewire, and others leading the way. But never in a million years did I imagine this. Swing? I thought SWT actually would beat Swing handily! ...
3
12538
by: Nuwang | last post by:
Hai, I'm using a swing to connect database with swing application... 1. How this swing connect with access database... 2. Important thing is how change Button size and Font size Still I couldn't manage my swing in proper layout pls run and check Code:
6
51162
by: r035198x | last post by:
I have put together this article to give people starting Swing an awareness of issues that need to be considered when creating a Swing application. Most of the Swing tutorials that I have seen just help people display some nice widgets quickly without explaining some issues that need to be tackled when a full application needs to be developed. This article does not go into full implementation details because those can be found by reading the...
0
8989
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9537
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9367
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9243
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8241
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6795
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4599
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4869
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.