on 02-25-2010 3:49 PM
Are there performance advantages to using an assistance class over a model in the component controller? I built a service class that uses several lower level persistent objects to handle table operations. Currently I instantiate the model in the WDOINIT of the component controller. I expose needed methods from the service class as methods of the component controller and the other components call through the component controller methods.
What advantages would I see if I remove the model and just use the service class as an assistance class? Is that even possible?
I don't believe there are any signifiant performance differences between the assistance class vs. seperate service class. They are basically the same thing. The big difference I see with the assistance class is that the reference variable is automatically declared in the WD Component - both at the component and view level. This simplifies development slightly because you don't have declare or instaniate this variable - but that is probably a minor issue.
The main difference is if you have multiple WD Components - like in Floorplan Manager and you want to share one class instance between all the components. Although if you create the inner component instances yourself you can pass a single assistance class instance through the creation process, this isn't necessary easy to do with a framework created component instances like in FPM.
In this case I perfer to create a separate service class that can be accessed via a static method call (returning the same instance with each request). That way in the initialization of each WD Component you access this single instance of the class - and share data easily between separate components.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for your help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
24 | |
11 | |
9 | |
7 | |
5 | |
5 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.