Thank you Mark, That explained lots of things :). I want to make a separate module class just for the sake of code organization. May be It's wrong to create a module class for every service category(data access, business logic..etc). What do you think ? Is it ok performance and architecture wise ?
I don't know how to specify a module in the web.xml, don't reckon I read anything about this ! About the auto loading, I thought it was meant only for the droppable jar feature. I think the @Submodule annotation will do the trick. Thanks a lot for your time :) On Sun, Oct 24, 2010 at 5:19 AM, Mark <mark-li...@xeric.net> wrote: > On Sat, Oct 23, 2010 at 6:29 PM, Muhammad Mohsen <m.gelb...@gmail.com > >wrote: > > > > > 2.Modules > > I simply created a class, suffixed it "Module" so it ended up being named > > "DataAccessModule". > > I added a > > public static void bind(ServiceBinder binder) { > > binder.bind(UserDAO.class, UserDAOImpl.class); > > } > > method just like my AppModule which works perfectly find. When I used the > > "DataAccessModule" to bind classes. As I @Inject them. They couldn't be > > resolved and I get a "Class not found exception". This module is under > the > > services package right beside "AppModule.java" > > So why aren't my services resolved ? > > > I think you want to put: > binder.bind(UserDAO.class, UserDAOImpl.class); > in your AppModule file instead of creating a new DataAccessModule for it. > You can bind a bunch of different things just by adding them to the list. > If > you take a look at your web.xml file you'll see there is a filter set to > "app" and that is going to load the AppModule. > > If you are wanting it to be separate in order to create a drop in > autoloading module, you need to check out the documents on creating > autoloading modules. > http://people.apache.org/~uli/tapestry-site/ioc-autoload.html > > If you want to have a separate module for DataAccess, you might be able to > add it to the web.xml or possibly use the @SubModule annotation (see the > section about IOC Autoloading). > > If you have an interface and its implementation that you want to load with > the binder.bind command, I think you'd usually put them in the services > package, but don't think it matters because you are going to explicitly > tell > Tapestry where to find them when you call bind in your AppModule file. > > Mark > -- *Regards,* *Muhammad Gelbana Java Software Programmer*