From java packages to C# assemblies, how to redesign?

E

Efkas

Hi

I am a new c# programmer since my project let java on the tablet to do
programming on windows. I was building an application all customized.
I had :
1. my own custom widgets (text areas, buttons, backgrounds).
2. what I called my components (group of widget ) ex: group of my
buttons to build a keypad
3. the main application instanciating a keypad that is draw in the
main window.

Each of these level was a package with different classes inside
extending java composite.

Or, in C#, the first level seems to be flushed, because the common
widget already have the custom features I added to my java version.
My problem is that I have some difficulties to imagine how to group
and rearrange my 3 levels from java to c#.

I have read on the subject, and it seems essential to have the
smallest winform application as possible, and use class library for
my components to have separate dll for each functionnalities. Is it
true?

More, suppose I already have my main application and a keypad
component in c#, is it preferable to draw the keypad on the main
window or popup a keypad in another window form? In fact, what I am
wondering is if it's possible to create a component with labels or
buttons inside but without winform and only display the positionned
buttons or labels in the main window?

Note I don't want use properties of winforms because I want it as
small as possible and I project use different skins for my
application.

A lot of questions that becomes quickly confusing... as my brain is
becoming :)

So please indicate me the "standard" if it exist or a prefered
solution or philosophy for a full custom application design.

Thanks
François

*-----------------------*
Posted at:
www.GroupSrv.com
*-----------------------*
 
F

Frank Hileman

Hello François,

You could create custom graphical classes and draw them onto a custom
control, or onto your main form. You need System.Drawing for that. However,
to get events and even to create a form you need a reference to
System.Windows.Forms. So the only reason for creating your own graphical
components would be for the custom gui and skinning. It would not be any
smaller in terms of referenced assemblies.

Here is an example of what I am talking about. The buttons, dials, back
panels are all custom graphical components:
http://weblogs.asp.net/frank_hileman/archive/2004/07/23/192509.aspx

Regards,
Frank Hileman

check out VG.net: www.vgdotnet.com
Animated vector graphics system
Integrated Visual Studio .NET graphics editor
 
P

Philip Rieck

Inline

--
-Philip Rieck
http://philiprieck.com/blog/

-
I had :
1. my own custom widgets (text areas, buttons, backgrounds).
2. what I called my components (group of widget ) ex: group of my
buttons to build a keypad
3. the main application instanciating a keypad that is draw in the
main window.
...
I have read on the subject, and it seems essential to have the
smallest winform application as possible, and use class library for
my components to have separate dll for each functionnalities. Is it
true?

Well, "smallest winform application as possible" is not really essential.
Instead, look at it as a series of goals
1. Logically partition your application. This will not determine size,
content, or count of assemblies( a .dll or .exe is an assembly, in general)
2. Look for points of reuse. If you are going to write several applications
that will have common functionality, can you package up the common
functionality? Would you want to reuse these someday? Sometimes it helps to
write your components to be reusable, so as to reduce coupling. This will
help determine your assembly makeup.
3. Optimize your assembly makeup for load time / response time while
running, etc.

Instead of going in with the goal of "make my exe smaller", think in the
normal terms of functionality partitioning and reusability.


More, suppose I already have my main application and a keypad
component in c#, is it preferable to draw the keypad on the main
window or popup a keypad in another window form? In fact, what I am
wondering is if it's possible to create a component with labels or
buttons inside but without winform and only display the positionned
buttons or labels in the main window?

You can do any of the above. In general, if the component you are creating
is not a full form, it's best to create either a Control from it (derived
from Control or base control), or a composite UserControl (lighter weight
than a form, but allows you to use a visual designer to easily create
composite controls.) It sounds like what you want is a UserControl
Note I don't want use properties of winforms because I want it as
small as possible and I project use different skins for my
application.
If by this you mean that you don't want to have a titlebar, border,etc, no
problem. Use a UserControl (although you can get rid of these in a form as
well.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top