From: Chuck H. <ch...@gl...> - 2010-10-26 18:02:26
|
Hi Amiel, Back to this. :-) On Oct 22, 2010, at 7:10 PM, Amiel Montecillo wrote: On Sat, Oct 23, 2010 at 7:36 AM, Chuck Hill <ch...@gl...> wrote: > On Oct 19, 2010, at 5:34 PM, Amiel Montecillo wrote: > > Long story: I have 2 apps that needs to use some common components (managing user accounts, EditUser, Payments ... etc). I have put the common components in a framework. > > > > Now each app have different user interfaces. (e.g. header, menus, footer, styles ...etc). Since my common components must not be tightly coupled to any app, there is a need to create some kind of wrapper component to contain each common component in each app. > > > > So I was thinking of instead of creating a bunch of wrappers for each common component, I would just create one wrapper that contains a WOSwitchComponent and stick any common component I want in there, problem is and if I understood correctly how WOSwitchComponent works, is that it dynamically instantiates the component but I need to set some attributes to my common component before pushing it. > > > > I hope I'm making sense, I'm finding it hard to explain. > > I am not sure that I understand what you are planning on doing or what you need to configure but, to me, it feels like you are going about it the wrong way. Some questions that may be useful: > > It's just an idea I had to encapsulate all functionalities in a component inside a framework without them knowing or touching the top level wrappers hoping to avoid bindings passed to it as well. I'd prefer bindings over calling methods. Can you give some examples of what information the components need? > - why do you think that you need wrappers for everything? I would usually just have one page level wrapper that pulled in what I needed. > > The app have some several tabs. Each tab have several sections. I want each section in a framework that corresponds to a component. Each component will not have any application specific attributes (e.g. styles or return to some application specific page). Components inside the framework are totally decoupled from any application so that I can just stick them into any. Is that a bad idea? I depends on how you do it. :-) That is what bindings are for. I have lots of components like this, others need the page or something to implement an interface for communication. Maybe what you want is Direct To Web? > - could the attributes for your common components come from the page (context().page()) or session? Rather than pushing the information into them, teach them to look for it > > - have you looked at ERXThreadStorage? That is another way to communicate context between disconnected parts Chuck > > On Wed, Oct 20, 2010 at 7:22 AM, Chuck Hill <ch...@gl...> wrote: > > OK, I will bite. Why the hell are you doing that? :-) > > > > > > On Oct 18, 2010, at 9:21 PM, Amiel Montecillo wrote: > > > > > Hello Guys, > > > > > > I know I am going to get a "why the hell are you doing that or worse WTF?" kind of reaction to this but I just need to ask. > > > > > > So is there? or is it a bad idea? > > > > > > Thanks, > > > Amiel > > > > > > > > -- > > Chuck Hill Senior Consultant / VP Development > > > > Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. > > http://www.global-village.net/products/practical_webobjects > > > > > > > > > > > > > > > > > > > > > > -- > > socket error: unable to connect to 127.0.0.1 > > -- > Chuck Hill Senior Consultant / VP Development > > Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. > http://www.global-village.net/products/practical_webobjects > > > > > > > > > > > -- > socket error: unable to connect to 127.0.0.1 -- Chuck Hill Senior Consultant / VP Development Practical WebObjects - for developers who want to increase their overall knowledge of WebObjects or who are trying to solve specific problems. http://www.global-village.net/products/practical_webobjects |