Talk:ResourceSuggestTextBox control

From Catglobe Wiki
Revision as of 06:52, 16 January 2009 by Catglobe (talk | contribs)
Jump to: navigation, search

Thuan: Do you want it to actually be used? or this is just an example?

=> Chinh:It is for demonstration purpose only. It aims at demonstrating the use of ASP.NET AJAX for developing an AJAX-enabled control that can be put inside an Infragistic as an editor


Thomas: Exciting! Personally I am not so happy about the web-service approach, is there a reason for not using AjaxPro instead to keep all related BL in one place? That is what I have against web-services, it was also the motivation behind ServerMethods that everything should be available in one place, so the poor developer could easily find it, alas it is but no more difficult than to search for the web service, however this is my thinking, any comments on that?

=> Chinh: sure we can do the same without using web-service as a.Chương has proposed a solution for that. But, it requires some more effort


Thuan: Long time ago Phuc requested for such a feature but we rejected it because of performance issues. That's why I should ask you before writing comments  :-P

Besides that:

  1. I think that jQuery.suggest is a great library which can be used to implement the intellisense feature for CGScript Editor :-P
  2. Can we implement the IScriptControl explicitly so that we can "partly hide" the GetScriptDescriptors and GetScriptReferences methods?
  3. ResourceSuggestTextBox is a custom control and it can be inherited. Therefore, using this.GetType().... for registering scripts is not recommended

Finally, I learned some new interesting things from this

=> Chinh:
  • I think we can overcome the performance issue by limiting the number of returned records. In the implementation, the returned records are always less than 10 and the performance is quite good. If that is not enough, I think we can implement some special db-access (direcly talk to the db) that by pass some overhead of current DBAccess.
  • Moreover, IMO, the control is a good candidate for replacing some features of adding to favorites. For example: whenever I have to fill in a User textbox, it should suggest all the possible users instead of only the ones in my favorites.

=> Thuan:
  1. We need one server call + 1 database access whenever we type in a character.
  2. It is only fast if we search for resources using StartWith or Exact.
  3. Querying the Resource table only means we cannot filter out deleted resources. Querying the Common_Resource view is too slow. Alternatively, we need to write N queries. Since the involved fields are common, we can execute them once.
  4. There is no access check!

=> Chinh:
Here comes the interesting part of the suggest plugin. In fact, after each key pressed, only after a timeout period when the client actually do a web-request. So if user is typing too fast, only the last word will be sent back for requesting a search. This is a nice thinking, because to me, when user is searching for something, they start typing really fast and then stop at the term that they expect it to be searched for
Moreover, there is a cache for the suggest (not study enough about this cache) but it seems to that the already searched term will not do a search request to server. For example: when you press back-space for deleting some letters.

1. I think that jQuery.suggest is a great library which can be used to implement the intellisense feature for CGScript Editor :-P
=> I have no idea
2. Can we implement the IScriptControl explicitly so that we can "partly hide" the GetScriptDescriptors and GetScriptReferences methods?
=> IMO, the interface is simple enough. But it is your choice of optimizing it
3. ResourceSuggestTextBox is a custom control and it can be inherited. Therefore, using this.GetType().... for registering scripts is not recommended
=> I’m not really sure about this

=> Thuan:
FYI: http://blogs.ipona.com/james/archive/2006/10/03/6710.aspx
An example: given that the NewControl inherits from ResourceSuggestTextBox but is it put in the CatGlobeWeb assembly, then:
string assembly = this.GetType().Assembly.FullName;
will be fullname of the CatGlobeWeb assembly.