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.

Design for retrievable information and database access -


i in following situation. make real world case put things clear. suppose have model cube in 3d space, , cube has specific material: object of type cube contains set of information spatial position, , type of material, string. cube passed around many algorithms , classes, can perform tasks, such rendering cube.

for happen, these algorithms , classes require additional info object, namely, material properties such reflectiveness. these info not specific object, can obtained means of current object data (namely, material cube made of).

technically, have database of materials, can resolve string declaration of material specific cube detailed info specific material. renderer need these info, in following possible situations:

  1. i pass cube and database renderer, , let renderer query database, info material, , render cube
  2. i make database global object, can queried regardless of position in code, saving need pass database around, creating implicit dependency against database
  3. i data material, , stick cube object somehow, removing need pass around or keep database active longer. once got data, i'm off. means cube added information @ later stage, being in sort of invalid condition until these data moved database cube.
  4. i consider cube object self contained information, define object data materials, , create new object containing merge of these 2 information, materialdescribedcube

is there known-good pattern kind of situation ?

i rendering object should not coupled database. let cube known properties out of persistence tier appropriate , carry them around part of state. i'd consider object-oriented design, because cube has information that's needed inside itself.

i think should material object composed inside cube. when query database cube material initialized @ time.

i can't tell if means option 3 or 4.

update: cube should have material, if it's default unknown instance default values transparency, absorbtivity, reflectivity, etc. object should valid. users can change if default not desired, object should valid.


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 -