-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 
Author Message
 Post subject: GUI-Handling
PostPosted: Thu May 12, 2005 11:10 am 
Newbie

Joined: Thu May 12, 2005 10:40 am
Posts: 16
Hi there,

I've got my first experiences using nhibernate without gui and think that's a great tool :D
Now i'want to write an application 'that' make's sense' with c# and forms.

Code:
***************************************
* B1 *     Filter 1, Filter 2         *
* B2 *     [Refresh-by-Filter-Button] *
* B2 **********************************
* B3 *    GRRRRIIIIIDDDDDD            *
* B4 *      line1                     *
* Bn *      line2                     *
*    **********************************
*    *   Display Busines-Data Details *
*    *   to in grid  seleted row      *
*    *   (maybe in Tabs)              *
*    *                                *
***************************************


Edited (sergey): I took the liberty to reformat your post a bit to make your ASCII diagram clear.

My Application should look similar to a 'outlook like application'.
On the left hand, a OutlookBar main-selection for the business class.
B1...Bn
If the user clicks on Bx, on top right i want to show 'appropriate' Filters for
the user
Using the Refresh-Button will fill my grid.
Klicking within the grid will 'Display selected Business Data'
in the lower right area.

I think that's not very spectacular.

Now i'm wondering if there's anything avaliable like the goood old Data-Binding-mechanism' for my GUI-work.

Yessss using nhibernate takes the 'most AND hardest programmer work' away from me , but gui is still a topic for me, and i don't want to do things
that can be automated..

Becouse i'm not that over-experienced with c#, i thougt about
to build a simple user-control for the 'Display selected Business Data'
area, which would hold in a very simple approach LABEL and TEXT
for my database-Property.
In a further step i want this component to be capable of
selecting the control depending on the db-type,
and in a overall final solution the controls would be created
on display time accourding to the business class.

Using own-written 'Attributes' in my Business class
i want to specify the 'label' there, and maybe later
things like 'user must specify field', and 'text-field-len is maximal
10 characters'.

Of course there will be situations, where that simple-concept won't fit,
but im want to be capable of doing 'stupid standard' gui.mapping with
as less effort as possible.

And of course a lot of this information is also available within the nhibernate-mapping, but for sure not all of them.

All the samples i've seen so far are without graphic,
so i'm wondering if anybody could give ma a hint how to deal with this ?

TX at all :P

Zoerrer Helmut


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 2:44 am 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
Hello, I just wanted to tell you I have seen your post and will try to reply when I have time.


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 11:24 am 
Newbie

Joined: Thu May 12, 2005 10:40 am
Posts: 16
hi sergey

would be nice :)

Only to clearify my posting,
i know how to bind the Ilist to my grid.

I'm interested in I/O Handling to stupid Controls.
And maybe that's much more a .NET topic than a nhibernate-problem.

I also know that binding business-objectst directly to control might not fit all situations, but for a special sub-scenario of my application, there's nearly no business-logic.

To clearify, I want my application to be capable of 'enhance the data' beinig shown (user-bo's) and deliver my apliccation with different 'bo-data-capatibilitys' for different industry-sectors.

For this industry-sector-add-on-bo-data's there will be only be a need for small 'business-integrity' rules to check for.
(field-length, mandatory-field, null allowed, pointer to xx-class, etc..)

Maybe that's also much more a typical portal-problem ....

So far i've seen, with .NET 2.0 there seems to be a much easyer way to bind to business-objects not dataset based.

But i'm not sure if this 'binding' solution fits for me, becouse it synchronizese only one property at one time, and what about max-len, madatory... ?

And maybe i don't need immediate synchronisation on value-change to BO or BO-proxy ?

Till now i think it would be best for me, to make something like a helper-class which get's knowledge about the control-container and the business-class and give this thing 3 methods ala

InitMycontrols ... search within coltrns of container and
find these ones, beeing 'supported'
choose/change control depending
on db-type, set max-len,
mandatory, label, ...
SetValues ... set control values by bo-data
GetValues ... set bo-data by contrlos

Of course the controls must know about to which property they belong,
but becouse i'll use a own component, something like a stupid text-property which i fill with the name of the db-property or bo-property should make this easy (txt to good old reflection...)

the situation will get heavier, if one control-change will need to change another one...
wwwwwwwwwwwooooowwwwwwwwssssssseeeeerrrsssssssssssss....
but i think that's out of my focus
if business rules check this, it's enough for my scenario...

But it would of course be very interesting for me, to see dealing with these things 'in a sample'

:wink:


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 13, 2005 4:34 pm 
Contributor
Contributor

Joined: Wed May 11, 2005 4:59 pm
Posts: 1766
Location: Prague, Czech Republic
For the GUI you may be able to use some code generation tools, there are templates for them to generate GUIs from the database, I believe. Of course it's not the same as having it all generated at run-time, but how do you specify layout and similar things in attributes? All those attributes will soon obscure the real code, then you'll start thinking about how to move them away to a separate file, then you'll want to edit the separate file visually, and in the end you'll arrive right back at the Windows Forms Designer :)

For the rest, I don't understand why data-binding won't work for you? It's of course a pain to get going and the MS implementation is full of bugs, but it does solve some problems.


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 17, 2005 4:42 am 
Hi sergey, thx for your reformat :-)

It would be nice to have a place where anybody could leave his let's call it 'metadata' he needs for whatever purposes. (in my case for GUI-Handling)
Attributes are in my opinion a nice way todo so, all together within the single class file...
And i think if java had a attribute-mechanism before 5.0 sdk, nhibernate-mapping mechanism could also be attribute-based ;-)

But of course a special file has also it's benefits.
* Is it possible to attach my additional-infomation to nhibernate without breaking rules for nhibernate-mapping ?
* can i eaysily get out database-mapping-information (fe. max length, datatype) and if point before is ok, my additional information from nhibernate (sorry for this question, my knowlege is'nt that deep till now, yess maybe it's only RTFM... nice would be a code-snipplet...)

> For the rest, I don't understand why data-binding won't work for you?
> It's of course a pain to get going and the MS implementation
> is full of bugs, but it does solve some problems.
o, of course it might work, i only want to get knowledge about what's the best way todo, before i start running in the wrong direction.


Top
  
 
 Post subject:
PostPosted: Tue May 17, 2005 8:50 am 
Beginner
Beginner

Joined: Thu May 12, 2005 3:41 am
Posts: 24
Location: London, UK
Anonymous wrote:
Attributes are in my opinion a nice way todo so, all together within the single class file...
And i think if java had a attribute-mechanism before 5.0 sdk, nhibernate-mapping mechanism could also be attribute-based

Actually, it was a design decision that no changes are needed to the business classes. There are several ORM solutions that require extending a base class, implementing an interface or adding attributes, but NHibernate allows you to map without changes - you don't even need the source code.
Having said that, you can use attributes for mapping in NHibernate with the NHibernate.Mapping.Attributes namespace from the NHibernateContrib project. (Incidentally, Hibernate has supported XDoclet tags for some time, and Hibernate 3.0 supports JDK 5.0 annotations).
Anonymous wrote:
* Is it possible to attach my additional-infomation to nhibernate without breaking rules for nhibernate-mapping ?
* can i eaysily get out database-mapping-information (fe. max length, datatype) and if point before is ok, my additional information from nhibernate (sorry for this question, my knowlege is'nt that deep till now, yess maybe it's only RTFM... nice would be a code-snipplet...)

You can examine the mapping metadata through the Configuration class, but you wouldn't be able to use this for your own metadata. A neater solution might be to use attribute-based mapping, create your own attribute classes for your metatdata, and use Reflection to access both.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 6 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.