Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

ruby - Protected and private methods in Rails -


method visibility in ruby (public, protected, , private methods) has been explained in places this blog post. in ruby on rails seems different in regular ruby application because of way framework set up. so, in rails models, controllers, helpers, tests, etc., when is/isn't appropriate use protected or private methods?

edit: answers far. understand concept of protected , private in ruby, i'm looking more explanation of typical way types of visibility used within context of various pieces of rails app (models, controllers, helpers, tests). example, public controller methods action methods, protected methods in application controller used "helper methods" need accessed multiple controllers, etc.

for models, idea public methods public interface of class. public methods intended used other objects, while protected/private methods hidden outside.

this same practice in other object-oriented languages.

for controllers and tests, please. both controller and test classes instantiated , called framework (yes, know can theoretically controller view, if that, strange anyway). since no 1 ever create things directly, there's nothing "protect" against.

addendum/correction: controllers, should mark "helper" methods protected private, , actions should public. framework never route incoming http calls actions/methods not public, helper methods should protected in way.

for helpers make no difference if method protected or private, since called "directly".

you can mark stuff protected in cases if makes things easier understand, of course.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -