1. Trang chủ
  2. » Công Nghệ Thông Tin

Apress Expert C sharp 2005 (Phần 14) pdf

46 364 0

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Định dạng
Số trang 46
Dung lượng 442,52 KB

Nội dung

AuthorizationRules class, 137–139 associating roles with properties, 138 BusinessBase class and, 125 CanReadProperty method, 125 checking roles, 138 description, 92 retrieving roles, 137 RolesForProperty class and, 136 AutoComplete attribute ServicedDataPortal class, 215 autonomy web services as services, 569 ■B background.jpg file files in Basic theme, 528 backward compatibility, 265 base classes see also classes business (CSLA .NET) framework, 91 business framewor k, 59 BusinessBase class, 59–61, 109–127, 139–142 BusinessListBase class, 61, 142–155 BusinessPrincipalBase class, 246 CommandBase class, 236–239 enhancing for data access, 169–176 factory methods and criteria, 171–172 inheriting from non-generic base classes, 60 NameValueListBase class, 239–243 ReadOnlyBase class, 62, 155–156 ReadOnlyListBase class, 62–63, 156–157 base index, 250 BaseIndex property ListItem class, 256 Basic theme, 528 Basic.css file, 528 Basic.skin file, 528 BeginE dit method BusinessBase class, 102, 116–117 BusinessListBase class, 102 deleting and undeleting child objects, 147, 149, 154 edit lev el, 145 IEditableObject interface, 118, 119 P rojectEdit loading user controls, 506 ProjectEdit saving data, 509, 510 UndoableBase class, 65 BeginLoadData method DataTable class, 292 behaviors behavioral object-oriented design, 50 data por tals , 76–82 dealing with common behaviors, 334 normalizing common behavior, 333, 334 relational and object modeling, 50 bidirectional data updates, 79 BinaryFormatter class cloning serializable object, 97 serializing and stacking Hashtable, 107 serializing object state, 98 BindableBase class, 66, 98–101 class diagram for, 67 description, 91 OnPropertyChanged method, 100 OnUnknownPropertyChanged method, 100 binding see data binding Binding object Format event, 299 Parse event, 299 BindingComplete event BindingSource control, 303 bindingEdit field, 119 BindingList class, 66 class diagram for, 67 data binding, 41 SortedBindingList class, 87 BindingNavigator control, 488 BindingSource control adding roleListBindingSource control, 500 BindingComplete event, 303 CanExtend method, 302 data binding, 288, 302 RolesEdit saving data, 491, 492 saving data with remote data portal, 493 setting DataSource property on, 500 smar t client calling web method, 596 using business class as data source, 487 BindingSourceRefresh control, 301–303, 504–505 extender controls, 301 ReadValuesOnChange property, 302, 505 using GetReadValuesOnChange method, 302 using SetReadValuesOnChange method, 302 Windows data binding, 303 W indows Forms data binding, 301 Boolean data type empty values, 280 broken rules ID ataE rr orI nfo interface, 124 maintaining list of broken rules, 133–134 V alidationRules object managing, 122 BrokenRule class, 134 description, 92 function, 68 maintaining list of br oken r ules , 69 brokenRules field maintaining list of broken rules, 133 B r okenR ulesCollection class, 134–135 Add method, 135 description, 92 function, 68 GetFirstBrokenRule method, 135 ■INDEX624 6323_Index_final.qxd 2/27/06 7:02 PM Page 624 maintaining list of broken rules, 69 Remove method, 135 ToString method, 135 BrokenRulesList class checking validation rules, 132, 133 Browsable attribute IsDirty property, BusinessBase class, 112 IsValid property, BusinessBase class, 114 business class structure, 374–402 common regions, 374–377 Criteria class, 377–379 private default constructor, 377 Serializable attribute, 374 business classes, implementing PTracker, 407–462 Assignment class, 439–441 Exists method, 455–456 ExistsCommand class, 456–457 main areas of each class, 405 Project class, 408–429 ProjectList class, 446 ProjectResource class , 434–439 ProjectResources class, 429–434 ProjectTracker application classes, 406 ProjectTracker objects, 405–407 PTIdentity class, 459–462 PTPrincipal class, 457–459 Resource class, 444–446 ResourceInfo class, 447–448 ResourceList class, 446–449 Role class, 453–455 RoleList class, 442–444 Roles class, 449–453 using business class as data source, 486–489 business concepts and process flow design creating use case descriptions, 323–325 project maintenance, 323–324 resource maintenance, 324–325 gathering application requirements, 322, 323 maintaining list of r oles, 325 programmatic access, 325 business framework see CSLA .NET framework business fr amewor k base classes , 59 business functionality, Web Forms, 537–562 P rojectEdit form, 552–562 ProjectList form, 548–552 RolesEdit form, 538–548 business functionality, Windows Forms, 482–512 creating forms as user controls, 467 MainForm form, 482–486 P r ojectE dit control, 497–512 ProjectList object, 494–497 RolesEdit control, 486–494 business logic authorization, 57 business object centralizing, 26 business objects , 21–24 encapsulation, 53 locating in multiple layers, 17, 18 locations for validation and manipulation business and data access tier, 20 common locations illustrated, 18 data management layer, 18 user interface, 19 locations for validation and manipulation, 18–21 managing, 17–32 mobile objects, 24–32 object-oriented programming, 160 shared between UI and data access layers, 27 sharing across tiers, 20 tracking broken business rules, 40–41 business logic layer 5-layer logical architecture, 10–11 description of role, 13 high security web client, 16 high-scalability smart client, 14 managing business logic, 17–32 mobile objects and logical architecture, 26 tied to UI and data access layers, 27 Business Methods region, 376 editable child business objects , 386 editable root business objects, 383 implementing Assignment class, 440 implementing business classes, 409–416 implementing Project class, 409–416 child collection properties, 414 instance field declar ations, 409 interdependent properties, 413–414 overriding GetIdValue method, 415 overriding IsDir ty method, 415–416 overriding IsValid method, 415–416 read-only properties, 409–410 read-write properties, 411–412 SmartDate properties, 413 implementing ProjectResource class, 435 implementing P rojectResources class, 429, 430–431 Assign method, 430 Contains method, 431 C ontainsD eleted method, 431 GetItem method, 431 R emove method, 431 implementing PTIdentity class, 459–460 implementing ResourceInfo class, 447–448 implementing RoleList class, 442 implementing R oles class , 450–451 business objects, 21–24 see also mobile objects business class str uctur e , 374–402 centralizing business logic, 26 command objects, 399–401 common regions, 374–377 component parts of, 23 composed of state/implementation/inter face , 23 ■INDEX 625 Find it faster at http://superindex.apress.com/ 6323_Index_final.qxd 2/27/06 7:02 PM Page 625 CSLA .NET design benefits, 340 CSLA .NET framework, 58–63 CSLA .NET in design process, 341 data portal returning updated business object to UI, 81 data transfer, 26 description, 22 designing Web Service interface returning and accepting data, 574 determining type of, in data portal request, 182 editable child business objects, 384–387 editable child collections, 394–395 editable root business objects, 380–384 editable root collections, 390–394 encapsulation, 21 framework classes used by business developers, 59 IEditableObject interface, 47 implementing business objects, 405–463 invoking methods on, 181 loading from database, 169 locating specific method, 177 managing persistence to data store, 54 models for UI dev eloper, 42–46 name/value list objects, 401–402 object design, 21, 326 potential objects and associated class names, 327 read-only business objects, 395–397 read-only collections, 397–399 referencing business object, 131 sending to data portal to be inserted/updated, 80 Serializable attribute, 374 serialization, 98 smart data and, 22 snapshot of, 102 structure with common regions, 375 switchable business objects , 387–390 UML sequence diagram for immediate deletion of, 82 UML sequence diagram for updating of, 81 UML sequence diagr am illustr ating cr eation of, 78 UML sequence diagr am illustrating retrieval of, 79 user interface interacting with, 77 using business object as data source R olesE dit w eb for m, 539–540 web service data transfers, 573 wrapping in transaction, 215 business objects , life cy cle of, 361–373 adding/editing root objects, 368 adding/editing/deleting child objects, 369–370 creating child objects, 363–365 creating root objects, 362 deleting r oot objects , 370–372 object creation, 362–365 object disposal, 372–373 object retrieval, 365–367 retrieving child objects, 367 retrieving root objects, 365–366 updating editable objects, 368–372 business rules see also rules common business rules, 273–276 CSLA .NET design benefits, 340 method signature for, 69 tracking broken business rules, 40–41, 67 BusinessBase class, 59–61, 109–127, 139–142 authorization rules, 125–126 AuthorizationRules object and, 125 CSLA .NET in design process, 341 description, 92 functional areas implemented in, 110 ICloneable interface, 126–127 implementing Project class, 408 inheriting from non-generic base classes, 60 methods AddAuthorizationRules, 123, 125 AddBusinessRules, 123, 274, 276 ApplyEdit, 102 BeginEdit, 102 CancelEdit, 102 CanReadProperty, 125 CanWriteProperty, 125 Clone method, 142 data access methods , 60 exception handling methods, 61 MarkAsChild, 60, 120 object-editing methods, 116–117 pre- and post-processing methods, 61 PropertyHasChanged, 274 Save, 79–81, 170, 173 SetParent, 121 n-level undo functionality, 64, 116–120 o verriding System.Object, 140–141 properties IsChild, 121 IsDeleted, 115–116 I sD ir ty , 112–114 IsNew, 111–112 I sSavable, 114 IsValid, 114 object status properties, 111 Parent, 121 purpose , 59 root/parent/child behaviors, 120–122 tracking business rules, 67 tr acking object status , 110–116 UndoableBase class and, 64 Update method processing, 222–223 validation rules, 123–125 ValidationRules object and, 123–125 ■INDEX626 6323_Index_final.qxd 2/27/06 7:02 PM Page 626 BusinessListBase class, 61, 142–155 BindingList class, 66 business objects subclassing, 341 deleted object collection, 146 deleting and undeleting child objects, 147–154 description, 92 edit level tracking, 144 functional areas implemented in, 142 ICloneable interface, 154–155 IEditableCollection interface, 65, 96 methods AcceptChanges, 153–154 Add, 61 ApplyEdit, 102, 154 BeginEdit, 102, 154 CancelEdit, 102, 154 ContainsDeleted, 146 CopyState, 150–151 DeleteChild, 150 InsertItem, 146 Remove, 61 RemoveChild, 145 Save, 170, 173 UnDeleteChild, 150 UndoChanges, 151–152 n-level undo functionality, 144–147 properties EditLevelAdded, 146 IsChild, 144 purpose , 59 reacting to Insert/Remove/Clear operations, 145 root/child behaviors, 144 sorting collections, 66 tracking object status, 143 BusinessPrincipalBase class, 246 Identity property, 246 interface implemented, 244 I sInRole method, 246 principal and identity objects, 83 buttons Login button, 479–481 b yte str eams converting Hashtable to, 107 ■C caching InvalidateCache method, 402, 443, 452, 453 ProjectEdit web form, 555 RolesEdit web form, 540–541 C allB yN ame helper method, 274 CallMethod method MethodCaller class, 181–182 SimpleDataPortal implementing data methods, 220 CallMethodException class channel adapter behaviors , 183–184 types required for channel adapter, 162 CallMethodIfImplemented method MethodCaller class, 182 SimpleDataPortal implementing data methods, 220 CanAddObject method editable root business objects, 383 implementing Project class, 418, 420 Cancel button ProjectEdit saving data, 510 CancelEdit method BusinessBase class, 102, 116–117 BusinessListBase class, 102 deleting and undeleting child objects, 147, 149 description, 118 edit level, 145 IEditableObject interface, 118, 119 ProjectEdit saving data, 510 UndoableBase class, 65 CanDelete property data source controls, 313 CanDeleteObject method editable root business objects, 383 implementing Project class, 418, 419, 421 CanEditObject method editable root business objects, 383 implementing Project class, 418 ProjectEdit authorization rules, 507 CanExtend method BindingSource control, 302 IE xtenderProvider interface, 296 CanGetObject method editable root business objects, 383 implementing Project class, 418 read-only business objects, 397 CanInsert property data source controls, 312, 313 CanReadProperty method BusinessBase class, 125 implementing P roject class, 410, 411, 418 implementing ProjectResource class, 435, 436 integrated authorization, 84 IR eadO nlyObject inter face , 96 ReadOnlyBase class, 156 C anRetrieveTotalRowCount property data source controls, 314 CanUpdate property data source controls, 313 C anW r iteP r oper ty method BusinessBase class, 125, 126 implementing Project class, 411, 418 implementing P r ojectR esource class, 435, 436 integrated authorization, 84 catch block try catch block, 585 ChangeType method D ataM apper class setting v alues , 283 ■INDEX 627 Find it faster at http://superindex.apress.com/ 6323_Index_final.qxd 2/27/06 7:02 PM Page 627 channel adapter behaviors CallMethodException class, 183–184 DataPortal class, 185–193 DataPortalEventArgs class, 184 EnterpriseServicesPortal class, 201–205 EnterpriseServicesProxy class, 200–201 IDataPortalProxy interface, 194 IDataPortalServer interface, 193–194 LocalProxy class, 194 MethodCaller class, 177–183 RemotingPortal class, 198–199 RemotingProxy class, 195–198 RunLocalAttribute class, 184 WebServicePortal class, 208–210 WebServicesProxy class, 206–208 channel adapter design pattern, 161–163 data portal combining patterns, 161 types required for channel adapter, 162 channels .NET Remoting channel, 605–609 data portal comparison of, 602–605 ease of deployment, 604 ease of implementation, 604 factors for comparison, 602 fir ewall friendliness, 604 host technology, 604 performance, 602 security, 603 Enterprise Services channel, 612–619 Web Services channel, 609–612 channels element implementing .NET Remoting, 608 CheckRules method BrokenRulesCollection class, 134 checking validation rules, 132, 133 implementing Project class, 414, 416, 424 maintaining list of broken rules, 133 child collection properties implementing Project class, 414 child objects adding/editing/deleting, 369–370 base class for creating editable, 139 BusinessBase indicating object is child, 60 B usinessListB ase class , 144 cascading call to, 106 collections , 65 creating, 363–365 definition, 120 deleting and undeleting, 147–154 descr iption, 120 edit level tracking for child objects, 122 editable child business objects, 384–387 editable child collections , 394–395 IEditableObject interface, 117 isChild field, 121 LineItem as example, 60 MarkAsChild method, 120 n-level undo functionality, 38, 144 object cr eation without defaults , 387 read-only collections, 398 RemoveChild method, 145 retrieving, 367 root/parent/child behaviors, 120–122 strongly typed collections of child objects, 41–42 switchable business objects, 387–390 UndoableBase class, 65 class-in-charge (Factory pattern) model, 45–46 business objects, 377 classes see also base classes business class structure, 374–402 business framework base classes, 59 complete code for, 92 Criteria class, 377–379 CslaDataSource class, 305–307 CslaDataSourceDesigner class, 310 CslaDataSourceView class, 307–309 CslaDesignerDataSourceView class, 310–314 DataMapper class, 280–285 final class list for PTracker, 338 implementing PTracker business classes see business classes, implementing PT racker ListItem class, 250–251 namespace organization, 88–89 NameValuePair class, 240 ObjectAdapter class, 286–294 ObjectFieldInfo class, 316–318 ObjectV iewSchema class, 315–316 primary base classes, 89 required to support editable/read-only business objects, 91 SafeDataReader class, 277–280 SortedBindingList class, 247–262 SortedEnumerator class, 254 classes, PTracker merging similar objects, 332 clean objects IsNew property, BusinessBase class, 111 ClearContext method DataPortal class, 228 ClearI tems method ReadOnlyBindingList class, 128 client configur ation implementing .NET Remoting, 608 implementing Enterprise Services, 618, 619 implementing Web Services, 611 Client folder , D ataP or tal, 93 client models high scalability smart client, 14 high secur ity w eb client, 16 optimal performance smart client, 13 optimal performance web client, 15 Client-side Code region command objects, 400 client side context data message objects , 73 ■INDEX628 6323_Index_final.qxd 2/27/06 7:02 PM Page 628 client side DataPortal, 71–72 data portal functionality, 71 methods, 71 RunLocal attribute, 71 client side proxy classes, 72 data portal functionality, 71 client-side cache invalidating client-side cache, 452 ClientContext collection DataPortalContext class, 167 ClientContext property ApplicationContext class, 230 ClientCulture DataPortalContext class, 167 ClientUICulture DataPortalContext class, 167 Clone method BusinessBase class, 142 ICloneable interface, 126, 127 implementing ICloneable interface, 242 cloning BusinessBase class, 110, 126, 142 BusinessBase class functionality, 110 BusinessListBase class, 154 BusinessListBase class functionality, 142 GetClone method, 127 ICloneable interface, 126, 154 ObjectCloner class, 126 ReadOnlyBase class, 156 ReadOnlyListBase class, 157 ser ialization, 97 Close button ProjectEdit saving data, 510 Close method closing RolesEdit user control, 493 RolesEdit saving data, 492 WinPart base control, 473 CloseWinPart method Panel control, 475, 476 code do wnload Diagrams folder, 93 Resources.resx file, 93 code reuse ar chitectur es and fr amewor ks, 32 focusing on most productive areas, 35 r eflection, 273 validation rules, 40 collaboration behavioral object-oriented design, 51 collections ArrayList and List<T> types compared, 41 BusinessListBase class, 61 B usinessListB ase class and sor ting, 66 cascading call to, 106 child objects, 65 deleted object collection, 146 editable child collections, 394–395 editable root collections, 390–394 getting items fr om, 254 IBindingList interface, 47 properties controlling editable collections, 451 read-only collections, 397–399 ReadOnlyListBase class, 62 sorting collections, 246–262 state and, 151 strongly typed collections of child objects, 41–42 System.Collections.Generic namespace, 41 column names ObjectAdapter class getting, 288–291 COM (Component Object Model) security and internal applications, 6 COM-based technologies optimal performance web client, 16 COM+ applications implementing Enterprise Services, 619 COM+ transactional context distributed transaction support, 215 command object lifetime of, 238 command objects, 399–401 common regions, 375 CommandBase class, 62, 236–239 purpose, 59 CommandBase object Update method processing, 224 common business rules, 273–276 common regions, 374–377 CommonRules class, 273 function, 68 implementing common rules, 69 implementing Project class, 416 purpose, 273 rule methods, 276 RuleHandler delegate, 273 CompareTo method ListItem class, 251 S martDate type, 269, 271 Complete method TransactionalDataPortal class, 217 complex relationships, revising, 329–335 adding Assignment class , 330 adding ProjectResources class, 331 adding R esourceAssignments class, 332 dealing with common behaviors, 334 merging similar objects, 332 normalizing common behavior, 333, 334 component-based ar chitectur e service-oriented design compared, 571–572 web methods, PTracker, 572 component-based w eb methods AddProject web method, 584–587 PTWebService project, 584 web service implementation, 584–587 Component Object Model (COM) security and internal applications, 6 ■INDEX 629 Find it faster at http://superindex.apress.com/ 6323_Index_final.qxd 2/27/06 7:02 PM Page 629 component-based, scalable, logical architecture see CSLA.NET framework components description, 572 services vs. components, 567 web services as components, 568–569 ComVisible attribute EnterpriseServicesPortal class, 202 implementing Enterprise Services, 615 ServicedDataPortal class, 216 configuration files, 186 ApplicationContext class managing, 232 implementing Enterprise Services, 615 Configuration namespace, 232 configurations high scalability smart client, 14 high security web client, 16 implementing .NET Remoting, 608 implementing Enterprise Services, 619 implementing Web Services, 611 optimal performance smart client, 13 optimal performance web client, 15 configuring site forms-based authentication, 531–533 connection pooling high-scalability smart client, 15 optimal performance web client, 16 Resource class sharing database connection, 445–446 scalability of physical model, 5 connections opening database connections, 445 constructors implementing ResourceInfo class, 448 non public constructor, 421 private default constructor, 377 ProjectResource class, 437 ProjectResources class, 432 using factory methods, 377 consumer applications grouping web methods into web services, 572 IntelliSense, 574 message-based communication, 565 SOAP and web services, 565 W eb Service authentication, 576 web service consumer implementation, 591–599 consumer-side proxy objects soapsuds .exe utility , 567 Visual Studio and, 566 web services, 566 C ontains method implementing ProjectResources class, 430, 431 ContainsDeleted method BusinessListBase class, 146 implementing ProjectResources class, 430, 431 ContainsKey method NameValueListBase class, 241 ContainsValue method NameValueListBase class, 241 Content control RolesEdit web form, 538 content pages master page and, 526 ContentPlaceHolder control master page, 527 ContentPlaceHolderID property RolesEdit web form, 539 context data/information, 166–169 ApplicationContext class, 229–233 ClearContext method, DataPortal class, 228 client and global context collections, 229–231 context and exception data flow to/from server, 167 data access, 224–233 DataPortalContext class, 167, 225–228 DataPortalException class, 168, 228 DataPortalResult class , 168, 228 message objects, 73 SetContext method, DataPortal class, 226 types r equired to implement, 169 control skin, 528 controls see also user controls adding subclasses of custom control, 489 BindingSourceRefresh control, 301–303, 504–505 Close method, WinPart, 473 control bound to a property, 295 creating forms as user controls, 467 not Form objects, 465 creating ProjectEdit controls, 498–505 defining control prefix, 523 displaying user controls, 483 ErrorProvider control, 502 loading/adding user contr ols, 475 MainForm hosting user controls, 474–477 ProjectEdit control, 467, 497–512 ReadWriteAuthorization control, 295–301, 504 removing user controls, 476 r esizing user controls, 476 ResourceEdit control, 467, 510 roleListBindingSource control, 500 RolesEdit control, 467, 486–494 user contr ol fr amewor k, W indo ws F orms, 472–482 interface design, 467–469 W inP ar t base control, 472–474 cookies reloading principal objects, 534 CopyData method ObjectAdapter class, 291–294 ■INDEX630 6323_Index_final.qxd 2/27/06 7:02 PM Page 630 CopyState method, UndoableBase class, 102–108 avoiding double-processing of fields, 105 cascading call to child objects or collections, 106 deleting and undeleting child objects, 150–151 getting list of fields, 105 serializing and stacking Hashtable, 107 skipping NotUndoable fields, 106 stacking data, 102 taking snapshot of data, 103–105 taking snapshot of regular fields, 106 CopyStateComplete method UndoableBase class, 105 Core folder, CSLA .NET project, 93 Core namespace, Csla see Csla.Core namespace corner.png file, Basic theme, 528 Count property, SortedBindingList class, 248 CRC cards aspects of initial design, 327 object design, 326 Create method, DataPortal class, 76–78 cr eating child objects, 364 creating root objects, 362 data passed to/from server for data portal operations, 73 distributed transaction support, 212–214 IDataPortalServer, 193–194 implementing data access methods , 191–192 purpose, 163, 174, 185 RunLocalAttribute class, 184 server side data portal, 74 Create method, SimpleDataPortal class message router functionality, 219–221 CreateInstance method, Activator class SimpleDataPortal implementing data methods, 219, 222 cr eating objects child objects, 363–365 object creation without defaults, 390 root objects, 362 cr edentials Login button, 480 secur ity in physical model, 5 smart client providing, 598–599 validating, web service implementation, 583–584 C r edentials field, S oapH eader attr ibute web service implementation, 582 criteria, 171–172 pr otected cr iter ia class, 242 Criteria class, 377–379 dual criteria classes, 388 factory methods and criteria, 172 implementing RoleList class, 443 inheriting from CriteriaBase, 172 instantiating corr ect business class , 243 naming, 377 nested criteria class, 172 read-only business objects, 397 criteria information creating criteria object, 73 data passed to/from server for data portal operations, 73 determining type of class in which criteria nested, 74 server side data portal, 74 Criteria object DataPortal_Create method using, 76, 77 DataPortal_DeleteSelf method using, 82 DataPortal_Fetch method using, 78, 242 implementing data access methods, 191 implementing Project class, 422 purpose, 172 SimpleDataPortal implementing data methods, 222 criteria parameter implementing Project class, 425 CriteriaBase class code-generation tools, 378 Criteria class and, 377, 378 implementing P roject class, 422 message router functionality, 218 types required for message router, 164 Crystal Reports, 286 reporting against objects, 86 CSLA .NET framework see also Csla namespace attributes NotUndoableAttribute, 65 business framework base classes, 59 business object design benefits, 340 business objects, 58–63 classes/controls BindableBase, 66, 98–101 BindingList, 66 B indingSourceRefresh, 301–303, 504–505 BrokenRule, 68, 134 BrokenRulesCollection, 68, 134–135 BusinessBase, 59–61, 109–127, 139–142 B usinessListB ase , 61, 142–155 BusinessPrincipalBase, 83, 246 C ommandBase, 62, 236–239 CommonRules, 68, 273 CslaDataSource, 305–307 CslaDataSourceDesigner, 310 CslaD ataS our ceV iew , 307–309 CslaDesignerDataSourceView, 310–314 CustomIdentity, 83, 245 D ataM apper , 85, 86, 280–285 DataPortal, 70–82, 162, 184–193 DataPortalContext class, 169, 225–228 DataPortalEventArgs class, 162, 184–185 DataPortalException class, 169, 228 ListItem, 250–251 M ethodC aller class , 162, 164, 177–183 ■INDEX 631 Find it faster at http://superindex.apress.com/ 6323_Index_final.qxd 2/27/06 7:02 PM Page 631 NameValueListBase, 63, 239–243 NameValuePair, 240 ObjectAdapter, 85, 86, 286–294 ObjectFieldInfo, 316–318 ObjectSchema, 314 ObjectViewSchema, 315–316 ReadOnlyBase, 62, 155–156 ReadOnlyBindingList class, 127–128 ReadOnlyCollectionBase class, 446 ReadOnlyListBase, 62–63, 156–157 ReadWriteAuthorization, 295–301 RuleArgs, 68, 129–130 RuleHandler, 68 RunLocalAttribute class, 162, 184 SafeDataReader, 85–86, 277–280 SmartDate, 85, 86, 263–272 SortedBindingList, 85, 87, 247–262 SortedEnumerator, 254 TransactionalAttribute class, 166, 210–211 TransactionalTypes class, 166 UndoableBase, 64–65, 101–109 ValidationException, 68, 135 ValidationRules, 68, 130–134 classes for creating, 91 classes used b y business developers, 59 command objects, 399–401 common business rules, 273–276 custom authentication, 82–84, 243–246 data access, 276–285 data binding, 66 data handling, 262–272 data portals, 70–82 distributed transactions, 210–217 editable child business objects, 384–387 editable child collections, 394–395 editable root business objects, 380–384 editable root collections, 390–394 framework design, 58–87 generic types, 95 helper types and classes , 85–87 implementing PTracker business classes see business classes, implementing PTracker integr ated author ization, 84 list of object types, 379 localization, 93 message router, 163 methods CanReadProperty method, 84 C anW r iteP r oper ty method, 84 n-level undo functionality, 63–66 name/value list objects, 401–402 namespaces , 88–89 Csla, 88, 139–157 Csla.Core, 88, 94–128 Csla.Data, 88 Csla.DataPortalClient, 89 Csla.Properties, 89 Csla.S ecur ity , 89, 136–139 Csla.Server, 89 Csla.Server.Hosts, 89 Csla.Validation, 89, 128–135 Csla.Web, 89 Csla.Web.Design, 89 Csla.WebServiceHost, 89 Csla.Windows, 89 naming convention, 88 polymorphism, 95 read-only business objects, 395–397 read-only collections, 397–399 referencing Csla.dll assembly, 407 report generation, 285–294 sorting collections, 246–262 switchable objects, 387–390 using in design process, 339–343 validation rules, 67–70 Web Service authentication, 575 CSLA .NET project creating directory structure, 93 folders in, table of, 93 saving blank Csla solution, 93 setting up, 92–94 Csla namespace, 139–157 see also CSLA .NET framework ApplicationContext class, 169 BusinessBase class, 139–142 BusinessListBase class, 142–155 BusinessPrincipalBase class, 246 CommandBase class, 236–239 CriteriaBase class, 164 DataPortal class, 162, 185–193 DataPortalContext class, 169 DataPortalEventArgs class, 162, 184–185 DataPortalException class , 169 DataPortalResult class, 169 description, 88 MethodCaller class, 162, 164, 177–183 NameValueListBase class, 239–243 ReadOnlyBase class, 155–156 R eadOnlyListBase class, 156–157 RunLocalAttribute class, 162, 184 SmartDate type, 263–272 TransactionalAttribute class, 166 T r ansactionalT ypes class , 166 Csla.Core namespace, 94–128 B indableBase class, 98–101 BusinessBase class, 109–127 description, 88 IBusinessObject interface, 94–95 IC ommandObject inter face , 97 IEditableCollection interface, 96 IEditableObject interface, 95–96 IR eadO nlyC ollection interface, 97 IReadOnlyObject interface, 96 NotUndoableAttribute class, 101 ObjectCloner class, 97–98 purpose, 94 ReadOnlyBindingList class, 127–128 U ndoableB ase class , 101–109 ■INDEX632 6323_Index_final.qxd 2/27/06 7:02 PM Page 632 Csla.Data namespace description, 88 ObjectAdapter class, 286–294 Csla.DataPortalClient namespace description, 89 EnterpriseServicesProxy class, 162, 200–201 IDataPortalProxy interface, 162, 193–194 LocalProxy class, 162, 194–195 RemotingProxy class, 162, 195–198 WebServicesProxy class, 162, 206–208 Csla.dll assembly defining control prefix, 523 PTWebService site setup, 579 PTWin project setup, 472 referencing Csla.dll assembly, 407 Csla.Properties namespace, 89 Csla.Security namespace, 136–139 AccessType enumeration, 136 AuthorizationRules class, 137–139 description, 89 RolesForProperty class, 136 Csla.Server namespace CallMethodException class, 162, 183–184 DataPortal class, 162 descr iption, 89 IDataPortalServer interface, 162, 193–194 ServicedDataPortal class, 166 SimpleDataPortal class, 164 TransactionalDataPortal class, 166 Csla.Server.Hosts namespace descr iption, 89 EnterpriseServicesPortal class, 162, 201–205 RemotingPortal class, 162, 198–199 WebServicePortal class , 162, 208–210 Csla.Validation namespace, 128–135 BrokenRule class, 134 BrokenRulesCollection class, 134–135 description, 89 RuleArgs class, 129–130 R uleHandler delegate, 128–129 RuleMethod class, 130 ValidationException class, 135 ValidationRules class, 130–134 Csla.W eb namespace , 89 Csla.Web.Design namespace, 89 Csla.W ebServiceHost namespace, 89 Csla.Windows namespace, 89 CslaAuthentication key custom authentication, 577 impor tance of naming file A pp .config, 470 web.config file, 523 CslaCredentials class smar t client pr o viding credentials, 598 web service implementation, 581, 581–582 CslaCredentials field, PTService class web service implementation, 582, 583 CslaDataPortalProxy element implementing .NET Remoting, 608 implementing E nterpr ise S er vices , 619 implementing Web Services, 612 CslaDataPortalProxy key, 186–187 EnterpriseServicesProxy class, 200–201 CslaDataPortalUrl element implementing .NET Remoting, 608 implementing Web Services, 612 CslaDataPortalUrl key, 187 CslaDataSource class, 305–307 CslaDataSource control, 304 Designer attribute, 305 event declaration, 306 GetType method, 315 handling events in a page, 306 Web Forms data binding, 305–307 CslaDataSource control, 303 classes required to implement, 304 CslaDataSource class, 304, 305–307 CslaDataSourceDesigner class, 304, 310 CslaDataSourceView class, 304, 307–309 CslaDesignerDataSourceView class, 304, 310–314 DeleteObject event, 305 EventArgs objects, 305 events raised by, 305 InsertObject event, 305 ObjectF ieldInfo class, 304, 316–318 ObjectSchema class, 304, 314 ObjectViewSchema class, 304, 315–316 refresh schema link enabled for, 310 relationship between classes in, 304 SelectObject event, 305 UpdateObject event, 305 Web Forms interface design, 523 CslaDataSource controls ProjectEdit web form, 554 CslaDataSourceDesigner class, 310 CslaDataSource control, 304 Web Forms data binding, 310 CslaDataSourceView class, 307–309 CslaDataSource control, 304 E xecuteInsert method, 307 ExecuteSelect method, 308–309 Web Forms data binding, 307–309 CslaDesignerDataSourceView class, 310–314 CslaD ataS our ce contr ol, 304 GetDesignTimeData method, 311–312 infor mation provided by, 310 ObjectSchema class, 311 Web Forms data binding, 310–314 CSS style sheet master page theme , 528 cultures see also localization setting ser v er context, 226 Current property IEnumerator interface, 254, 256 CurrentPrincipal property, Thread class Login button, 480 ■INDEX 633 Find it faster at http://superindex.apress.com/ 6323_Index_final.qxd 2/27/06 7:02 PM Page 633 [...]... undeleting child objects, 150 editable child business objects, 386 IsDeleted property, 115, 116 deleted object collection BusinessListBase class, 146 DeletedList deleted object collection, 146 deleting and undeleting child objects, 147 implementing ProjectResources class, 434 DeleteObject event CslaDataSource control, 305 ProjectDataSource control, 557 ProjectListDataSource control, 551 ResourcesDataSource control,... public properties, 53 object-relational mapping and, 49–56 separation of ORM logic into persistence object, 53 physical architecture description, 2 layers and logical architecture, 2 logical and physical architectures, 1–17 physical model, 4–8 performance, 5 scalability, 5 physical n-tier architecture logical n-layer architecture and, 2 physical n-tier architecture benefits, 3 relationship between logical/physical... applications security in physical model, 6 s F facade designing Web Service interface, 575 Factory design pattern class in charge model, 45–46 factory methods, 171–172 common regions, 375 creating child objects, 363, 364 creating root objects, 362 CustomIdentity class, 245 dual factory methods, 388 editable child collections, 395 implementing Project class, 420–421 implementing ProjectResources class,... source controls, 313 GetValue method returning objects, 106, 285 GetViews method ObjectSchema class, 314 Global Assembly Cache (GAC) alternative to IIS, 531 global context data DataPortalResult class, 228 GlobalContext collection DataPortalContext class, 167 DataPortalResult class, 168 implementing data access methods, 190–191 GlobalContext property, ApplicationContext class providing public access... PTWebService, 591 projects addProject procedure, 351 assigning resources to projects, 558–559 deleteProject procedure, 352 deleting project, 485–486 editing project, 483, 485 existsProject procedure, 350 getProject procedure, 350 getProjects procedure, 349 selecting project, 496–497 updateProject procedure, 351 Projects menu, 474 Projects table, PTracker, 346 primary key, 444 ProjectSelect form brief description,... ResourceEdit editing resources, 510 security roles and resource roles, 326 updateResource procedure, 356 Resources collection assigning/unassigning resources, 511 ProjectEdit control binding to, 501–502 Resources menu, 474 Resources table, PTracker, 346 primary key, 444 Resources.resx file code download, 93 resourcesBindingSource control binding to Resources collection, 501 ResourcesDataSource control,... see PTracker application project tracker database see PTracker database project tracker project see ProjectTracker project ProjectData class copying properties from Project, 590 web service implementation, 586–587 ProjectDataSource control, 556–557 DeleteObject event, 557 ProjectEdit control, 497–512 adding roleListBindingSource control, 500 authorization rules, 507 binding to Project class, 498–500 binding... editing project, 483 layout of, 494 selecting project, 496–497 ProjectSelect_Load method displaying data, 494 ProjectTracker application classes, 406 ProjectTracker objects, 405–407 ProjectTracker project library of business classes, 406 referencing Csla.dll assembly, 407 setting up, 406–407 ProjectTracker.Library business objects web service data transfers, 573–574 ProjectTracker.Library namespace implementing... description, 522 MultiView control, 552 ProjectDataSource control, 556–557 ResourceListDataSource control, 560 ResourcesDataSource control, 557–559 RoleListDataSource control, 559 SaveProject method, 556 saving project, 555–556 ProjectEdit.aspx content pages, 527 ProjectInfo class final class list for PTracker, 338 inheritance, 341 ProjectList class, PTracker business functionality, Windows Forms,... object inheritance, 243 integrating with data portal, 246 CustomPrincipal class, 243 forms-based authentication, 534–535 Login button, 480 private constructor DataPortal_Create method, 77 private default constructor, 377 private keyword business object interface, 24 procedural model distributed architectures, 25 process flow design see business concepts and process flow design programmatic access use case . 455–456 ExistsCommand class, 456–457 main areas of each class, 405 Project class, 408–429 ProjectList class, 446 ProjectResource class , 434–439 ProjectResources class, 429–434 ProjectTracker application classes,. collection DataPortalContext class, 167 ClientContext property ApplicationContext class, 230 ClientCulture DataPortalContext class, 167 ClientUICulture DataPortalContext class, 167 Clone method BusinessBase class,. 445 constructors implementing ResourceInfo class, 448 non public constructor, 421 private default constructor, 377 ProjectResource class, 437 ProjectResources class, 432 using factory methods, 377 consumer applications grouping

Ngày đăng: 06/07/2014, 00:20

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN