使用条纹的电子商务
我们计划使用 Stripes + Hibernate 启动一个电子商务项目。
请让我知道拥有管理员和管理员是否有好处。用户部分位于同一项目或两个单独的项目中。 如果它是单个项目,我如何分离管理端代码和管理端代码?用户代码。
例如:如果我在 com.ecommerce.adminactions 包中有管理操作,在 com.ecommerce.useractions 包中有用户操作,我是否应该使用dynamicmappingfilter 将管理请求定向到 com.ecommerce.adminactions 并将用户请求定向到 com.ecommerce.useractions ?
-http://myecommerce.com/admin/* ->应始终访问 com.ecommerce.adminactions
-http://myecommerce.com/ ->应该去 com.ecommerce.useractions
或 我应该在每个类中使用 @urlbinding(/admin/st.action) (硬代码)。
要求是他们需要多商店概念。 请让我知道您对此的想法。您的想法&建议会有帮助
谢谢
We have planned to start an e commerce project using Stripes + Hibernate.
Please let me know if it is good to have admin & user part in same project or two separate ones.
If it is a single project , how do i separate admin side code & user code.
for eg: if i have admin actions in com.ecommerce.adminactions pacakge and user actions in com.ecommerce.useractions package should i use dynamicmappingfilter to direct admin request to com.ecommerce.adminactions and user request to com.ecommerce.useractions ?
-http://myecommerce.com/admin/* - > should always go to com.ecommerce.adminactions
-http://myecommerce.com/ -> should go to com.ecommerce.useractions
or
Should i use @urlbinding(/admin/st.action) in each class (Hard code).
The requirement is they need multistore concept.
Please let me know your thoughts on this.Your thoughts & suggestions will be helpful
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Stripes 框架 并不会真正影响您应该如何组织项目或如何组织项目的决定。 IDE项目结构,甚至Java包结构或URL结构。
一个或多个项目
除非您有许多开发人员,否则请将其全部放在一个项目中。
包结构
包结构应该组织您的 Java 类,以便您将逻辑上相关的类(由您的体系结构定义!)放在同一个包中。例如:com.ecommerce.action.admin 和 com.ecommerce.action.。另请参阅:正确打包您的 Java 类
URL 结构
通常,您希望 URL 结构能够反映网站的逻辑结构(与技术结构不同)。要实现此目的,您不应依赖默认 URL,而应使用 @UrlBinding。使用注释,您不必对链接进行硬编码,因为所有生成的链接将自动使用 UrlBinding 模式。
多商店概念
对于多商店概念,您需要在应用程序中构建逻辑来区分不同的商店。例如,将商店 ID 添加到您的 URL 参数中。或者通过检测所使用的(子)域名并将其映射到商店 ID(您可以通过使用拦截器来实现这一点)来更复杂。
The Stripes framework does not really influence decisions on how you should organize you're project, or how you should organize your IDE project structure, or even Java package structure or URL structure.
One or more project
Unless you have many developers, keep it all in a single project.
Package structure
A package structure should organize you're Java classes so that you put classes that are logically related (as defined by your architecture!) is in the same package. For example: com.ecommerce.action.admin and com.ecommerce.action.. See also: Properly package your Java classes
URL structure
Typically you want you're URL structure to reflect the logical structure of your website (not the same as your technical structure). To accomplish this, you should not rely on the default URL's but use @UrlBinding. With the annotation you do not hard code links, as all generated links will automatically use the UrlBinding pattern.
Multi store concept
For a multi store concept, you will need to build logic in your application for distinguishing between the different shops. For example by adding a shop id to your URL parameters. Or more sophisticated by detecting the (sub)domain name used and map that to a shop id (You can implement this by using an interceptor).