What is the value of multiple Hybris extensions? - spring

This is a question about web based software architecture. I am a Hybris newbie, but as I understand it, you can create a full Spring MVC app in one Hybris extension. What is the value of breaking out components of that app into multiple Hybris extensions? Are there web app features or architectural value (e.g. maintainability, extensibility, performance, etc...) that you can only realize by using multiple extensions?
Thanks!

So Hybris is based on the concept of being flexible and modular, allowing new functionality to be plugged in where needed via extensions. An extensions is an encapsulated piece of the Hybris Suite that can contain whatever you need it to contain, I.E. storefront, hMC, backoffice, etc. By default extensions are completely independent, however you can create dependencies between extensions no problem.
Say you're building an application that you want to have a section in the hMC, a frontend and some functionality in the backoffice too. In general you would have 4 extensions here:
a core extension for the model, services, interceptors, etc
hMC extension
frontend extension, pluggable frontend
backoffice extension
The real value of extensions is they allow hybris to be flexible and modular allowing for easy migration from one version of hybris to another.

Related

Laravel - Default vs Modular Approach

What's the recommendation on grouping your business logic in Laravel? I find Laravel to be quite messy when it comes to large web applications. Should we continue to use Laravel default file locations or have anyone tried using a modular package like https://github.com/nWidart/laravel-modules ?
Laravel is a fantastic platform, not only for its elegant syntax and rapid development tool, but also for its community and open source packages. These bundles go a long way toward reducing development time.
Modules
Modules are like packages in that they have their own Models, Views, Controllers, Migrations, and other classes.
All Controllers and Models are placed in the app/ folder by default in a Laravel program, while Migrations, Seeder, Providers, and other components have their own folder.
These folders become inconvenient when the application develops. It becomes difficult to locate logic for a specific portion of the application.
This is where using a modular approach to large projects simplifies production and maintenance. You can build different modules for different parts of your application using Modules. Each module has its own set of configuration options, such as controllers, models, views, migration, seeders, and providers.
To use modules in Laravel, simply autoload the Modules folder using PSR-4 and you're finished. However, this will entail additional tasks such as registering a namespace for language, views, and configuration, as well as running the migration.
Laravel Modules
Installing Laravel Modules is similar to installing any other
package.
Laravel Modules provides Artisan Commands to create new Modules,
activate/deactivate modules, create migrations. Below is a quick
screenshot of the different artisan command it provides.
When you create a new module it also registers a new custom namespace
for Lang, View, and Config.
Lang::get('blog::group.name');
#trans('blog::group.name');
Apart from these it also provides useful Facade Methods, Module
Methods
And also can publish your modules similar to a package (document).
How we used Laravel Modules?
Initially, when we started working on a pos (point of sale) application we didn’t have an idea of creating different modules.
But as the requirements increased to have a plug-play Restaurant extension for it, the idea of making modular made more sense.
So after creating and adding restaurants and many other optional modules, we added a setting for each business to enable or disable different modules.
Module::all(); method was used to list different modules the application had.
Each business can enable or disable modules for them as per their needs.
We used a combination of Module: has(‘blog’); business settings to check if a module is available & enabled.
The Module (or extension or plugin) can be put in any other application to add the functionality.

Saas With ExtJS + Spring + MySQL

We have an idea of developing a SaaS application using below technology.
Frontend HTML5 UI Framework - ExtJS
Backend Application - Spring + JPA
Database - MySQL
Please clarify on below things.
Considering the fact 'Modern web application should be stateless' for scaling purpose how do i manage sessions in this case?
Is Spring Security is mature enough to support SaaS applications.
Being a SaaS application I need to have lot of customization per tenant(i.e Display custom fields in forms, Display custom column in tables). What is the recommended approach to achieve this?
I need different look and feel of application based on type of user logged in. Say I need to display/hide a tab based on user role. How to achieve this? Should these roles need to be downloaded to browser and toggle UI elements based on user role?
I choose to go with separate schema Multitenancy. Is Hibernate is way to go or I can go with any JPA(EclipseLink)?
Any other technology limitations which i need to aware of with this combination.
Any input will be helpful.
Thanks,
John
1: I reject the premise that "Modern web application should be stateless" and I would like to see some citations for that statement. You can achieve scalability in a statefull application same as you can build a stateless application that doesn't scale at all.
2: It's more a question of "is it mature enough for commercial applications?" and I would say yes, it is. Depending on the actual requirements of your application, it may or may not be suited, but that has less to do with maturity than features.
3: Hard to say based on the very limited information provided. Anything from creating custom view instances (jsps, velocity-files, JSF2 views or which ever view technology you use) to dynamic, database-driven views to a full-blown CMS platform.
4: See answer 3 above. I general though, you build views in such a way that elements a user is not authorized to view are not rendered. Spring-security has taglibs for this type of functionality
5: Again, not enough information. Hibernate 4 ostensibly has support for multitenancy, but you will have to verify that it fulfills your particular requirements. AFAIK, there is no concept of multitenancy in the JPA standard (yet).
6: No doubt, but can't say what based on the information you provided. There are no inherent incompatibilities between the technologies you mention, but there are always limitations. Spring can't make coffee. JPA is lousy at driving your kids to school.

using magento apis for ecommerce website

I am a beginner in magento and am working on creating a website using magento. I have noticed that magento has a good number of apis that expose all of the functionality that I would need to create an ecommerce website. So, I would like to use magento's apis to fetch data, but develop the UI separately without any dependencies on magento. I have found a lot of references that develop the website via magento theming, but not those where the UI is developed in a separate MVC and uses magento purely as service layer. Are there any problems/issues in my approach?
Edit: I have gained a lot of clarity on db performance issue in apis and how external caching can alleviate the issue, but I still don't understand the underwhelming use of magento as a service layer (i.e. fueling the website by using magento's apis), are they any other gotchas?
Here is how we overcame slowness in Magento APIs:
Created a Web service provider in J2EE, Spring MVC that acts as a proxy between Magento and end users.
J2EE Web service provider exposes pretty much all the APIs that Magento has but also supports JSON with REST along with SOAP & RPC.
J2EE Web service provider uses a document based database (MongoDB) to store a snapshot of product catalog in MongoDB.
J2EE Web service provider uses native MongoDB caching to serve data fast without running any expensive SQL queries.
To avoid dirty caching issues we created a hook in Magento Admin to push data into MongoDB whenever data changes in Magento.
This might sound like overkill to some but we have been able to achieve pretty high throughput without any slowness.
The Magento APIs are slow, you would encounter serious performance issues trying to run a site off of it.
Due to the complex nature of the EAV model, you may find it difficult to manage products through the API alone.
Are there any particular concerns you have about using Magento's own frontend? It is daunting at first but once you understand the layout system it's actually very powerful and customisable.
Technically it is possible to run a site only through the API.
The issue you might face is a practical one, instead of spending your time trying to learn all the API calls, you can learn how to implement your current UI in Magento.
The advantage to this approach is that you will also better understand how Magento works internally, thus allowing you to leverage it's functionality for your unique business needs.
Another issue is that when using API's you have a little less control over how things are processed / calculated, vs when working in Magento itself there is a lot of control over specifics.
I regularly see "session expiration" issues when accessing Magento's API, through both SOAP and XMLRPC. All my calls require exception handling to avoid halting execution. I imagine that alone would create a nightmare when building everything on top of the API.
The best answer you're going to get is to Load Test the API before you start coding. Log the tests extensively and look for errors. If you see errors on a normal basis that should answer your question. Even if you find documentation that says it's okay to do what you're trying, you're still going to have to tune the API to work properly under the load required to run the store.
It will be good to know what you're up against before sinking hours into development.

Spring MVC and dynamic module deploy

I completed a new MVC web application and my boss asked me to create a new version for a new custumer. Same web application but differente CSS and two new modules (for module I mean a new page used by user to interact with DB). It's not a big deal and quite easy to do, just duplicate the project in my Eclipse and modify it. Two days work and project completed. Well done, all happy but not me.
I was thinking to wordpress, it's really customizable, just create a new template and plugin and activate it. I'd like to do somenthing similar to reduce the new version deploy and the code mainteneance. My question is, how can I do something similar with Spring? or better, is it possible to create a new module and deploy it for a web application? is the Spring dynamic the right option for a MVC Spring application?
thanks,
Andrea
I don't think your approach is correct. You need to discuss with your manager whether this situation is likely to repeat. Because to me it looks like it might.
Let's imagine a scenario: you have a number of copies of your app with some minor enhancements or changes between them. A month later one customer reports about a bug that's really nasty and has to be fixed in every of your app instances. Imagine your pain.
Why don't you approach it with multi-tenancy in mind?
Implement white-labelling, so that depending on the customer your application can get different looks;
Extend the backend, so that customers don't ever see each other's data
Implement configurable features, so that one customer doesn't see extended features that your boss sold to another customer. When he does sell them - it's going to be a matter of toggling a few flags in the database/configs.
Don't want to support multi-tenancy or the product is physically deployed on different (customer) servers? Doesn't matter! If you find a bug, you fix it once and redeploy the jar-file to all the affected systems.
Granted, the above isn't two days of work, but down the road this approach may save a lot more.
As to your question, Spring allows you to customize its looks via changeable styles and layouts. I suggest you to create a sample web app with Spring Roo to see how it's done. However, if I were you I would still aim to have a shared codebase between the projects at the very least.

On AWS SWF, what is the good approach to publish the user interface (html css js)?

To start with, please be sorry, I just start developping applications on AWS and I have some question that could be easy for you but not really for me... But impossible to find any response about web integration of a java website on SWF...
I'm also a new user of the spring framework, I need to do some tutorials about it (or not? SWF documentation can be enough?). But my questions are for those who have already passed time on it and can say what is the best aproach in my case. (And why?)
What is the good approach in UI design to have a web based application with ui dynamic changes? (like content slide, menu, etc... the most scalable choice)
Having the view (GWT web interface running on Elastic Beanstalk for example, or a CloudFront PHP interface using a good MVC PHP Framework?) separated from the model running on SWF? All linked by the API's.
Or having my complete web application using Flow FrameWork and GWT? (or another technology? For now I chosed this even if I have to work tutorials too, but why not using the new Dart Google's solution?)
What is the easiest approach to do it efficiently?
I understood the SWF logical approach, and I have all my project's architecture (so the scalable SWF Model) in my head, but clearly, if I want to add a new service in my project and if this service wants to get a list of existing objects (stocked in DynamoDB for example), i'd like to show this information easily because I already did it for this object.
And so, with a copy of the model on the PHP interface, I imagine I could associate methods to show this object, and so concentrate the PHP projet for showing my objects and start workflows with PHP (search and read-only?), and SWF to have a good working model launching those WF. Is it a good approach? Is there a PHP framework really adapted to do this? Rather, I do it on a non-swf java UI application?
Finally I found what I was searching about. To connect an UI interface, we have just to use good classes of the SDKs :
http://docs.amazonwebservices.com/AWSSDKforPHP/latest/index.html#i=AmazonSWF
http://docs.amazonwebservices.com/AWSJavaSDK/latest/javadoc/index.html
My question was really simple, but I wasn't able to understand the entire SWF architecture.
So the solution is to implement the application's MODEL-CONTROLER with the SWF Flow FrameWork, and after that, we can connect the VIEWs with any of the SDK to start workflows. We can also connect an Android or iPhone application easily with the good SDK.

Resources