I have a ERP project with modules stock, purchases and sales. These are web applications, using hibernate, maven, springMVC and spring security. What is the best way to organize the structure of this project?
1 - Each application being a web module(.WAR);
2- Just one web module.
On both approach there are other modules: core(with daos and services), and commons(with shared utils classes).
I was using the first way, because is easier to split each project with your respectves programmers. But i had problem with spring security configurations.
Any other options?!?
Sorry about my english
Your question is very open and answers may be highly subjective. You're stating a very limited number of requirements, hence you can go either direction.
There is a lot to be said for compartmentalizing an application. There isn't many larger organizations around that haven't acknowledged the need to do so. Often that way is paved for people already, i.e. existing guidelines exist that specify the component boundaries. It helps with understanding (sub-)domains, having parallel projects in flight, and very importantly reuse.
That all doesn't mean much if you have no business or technical requirements prompting you to do so. Instead, as a developer, you may rather focus on being prepared for change (once new requirements arise). So, have (unit) tests in place, et cetera. Change should be easy.
Related
I am a completely fresher for Spring Boot. I had learn to perform Basic CRUD operations using REST API. That basic knowledge is enough to working with Spring Boot Project. Can I able to work with that?
No one is technically perfect!
Every day we are exploring new things and implement new solutions as per the new business requirements. The developer should possess a good set of problem-solving skills. That’s because it’s common for developers to come across multiple programming problems while building just about any solution.
If your lead assigned a task to you explore quarkus and implement a simple CRUD operation using go language what you will do?
"I don't know golang", Is this your answer?
Qualities of a good junior software programmer
Learn new things daily which must be useful to the growth of the company, your team and you.
Problem Solving and Logical Thinking
Written and Verbal Communication
Teamwork
Interpersonal skills
Time management
How do I search for answers from StackOverflow like a PRO? This is a very important skill set, Really, I am not joking.
Health - Health(Physical/Mental) is an important asset, don't take official things personally. Manage stress etc...
Coming to technical side
It would be good if you know at least one programming language, in your case java is fine. But if you have the listed skill sets you can learn anything very easily.
Regarding Spring boot
Do you want to become an expert in the Spring framework? Work with one big project, whatever domain.
Refer - https://www.baeldung.com/
Once you become pro - Refer - https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/
As a starter this is fine, but if your application is going to face real customers/users and want to evolve your application over time, then you would need to consider concepts like below
Login/logout security with Spring Security (if stateless then JWT is a good choice)
Evolving code and database with versions of your software (can use Liquibase to evolve and maintain DB changes ).
Handling exceptions as Aspects from Spring.
Having coded business errors so your team can resolve them and classify them accordingly.
I want to create a production management system to be used by a small manufacturing firm. The system will allow to document different stages in manufacturing of equipment. The requirements are as follows:
1.Non browser based interface.Need something like Swing or AWT based.While i understand the convenience of implementing a browser based solution,the business owner insists on a non browser interface
2.Accessed from multiple systems.These systems will allow CRUD operations on the central system (Thin Client?)
3.The application will not have more than 3 concurrent users.
I need some advice regarding what would be a good path for this kind of application.Currently, i'm thinking of using Griffon with RMI. However, i don't have much development experience.Read a bit about Apache River (Jini) too.Would it be a good idea to use Griffon with RMI?
Please provide some advice. Thanks.
EDIT:after some reading, i've decided to use more mainstream frameworks.So, Griffon is not an option. How about Jini(Apache River) or OSGI (Apache Felix)?
Hmm how is that a project which recently moved out of the incubation phase be considered mainstream vs a project that's been used in production for more than 3 years now? Anyway, Apache River gives you access to Jini technology and nothing more; meaning you can't achieve item #1 of your list with River alone. River may use RMI for accessing remote resources, however you can use RMI directly, or try out DRMI, Kryonet, Hessian/Burlap, Spring's HTTP Invoker, Protocol Buffers, Avro/Thrift, REST, SOAP, ZMQ and many more.
Even if you choose one of these options and/or River you still have to define the following things
application structure (file structure and runtime behavior)
build setup
dependency management
testing profiles
packaging
deployment strategies
These things and more are what Griffon brings to the table. As you may have noticed the framework allows you to build up applications by adding plugins, reducing thew amount of time you must allot for hunting down dependencies, setting up bootstrap mechanism and getting things done. On the subject of remoting technologies have a look at the different options Griffon has to offer http://artifacts.griffon-framework.org/tags/plugin/remoting
Even more, you can also combine OpenDolphin (http://open-dolphin.org/dolphin_website/Home.html) with Griffon. There's even an example application found at the opendolhpin repository showing a full client-server application (build with Griffon, Grails and OpenDolphin) https://github.com/canoo/open-dolphin/tree/master/dolphin-griffon-crud
With what seems to be your current understanding of the problem, I would not recommend OSGI, especially for a small manufacturing firm (Possible maintenance issues, depending on the "personel").
The main reason why I wouldn't advocate JINI or OSGI in your case is because of what you said
However, i don't have much development experience.
JINI (Apache River) is a viable option as long as you fully understand the concepts of LookupService and service registrations, etc. There's tons of RMI going on here with possible firewall implications...
OSGI is not difficult but you may have issues deciding how to structure your applications as well as interacting with services, etc.
Try to stick to the simplest approach that you can handle for the implementation (Flexible design in mind): Make it work and then improve it.
There are simple Web Services options such as Spring Remoting (over http/https for example), unless Spring introduces too many concepts and headaches for your app.
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.
I’m developing a part of an application, named A. The application I want to plug my DLL into, called application B is in vb 6, and my code is in vb.net. (Application B will in time be converted to vb.net) My main question i, how is the best way for me to organize my code (application A)?
I want to split application A into layers (Service, Business, Data access), so it will be easy to integrate application A into B when B is converted to vb.net. I also want to learn about all the topics like layered architecture, patterns, inversion of dependency, entity framework and so on. Although my application (A) is small I want to organize my code in the best way.
The application I’m working with (A) is using web services for authenticating users and for sending schema to an organization. The user of application B is selecting a menu point in application B and then some functions in my application A is called.
In application A I have an auto generated schema class from an xsd schema. I fill this schema object with data and serialize the object to a memory string (is it a good solution to use memory string, I don’t have to save the data yet), wrap the xml inside a CDATA block and return the CDATA block as a string and assign the CDATA block to a string property of a web service.
I am also using Entity framework for database communication (to learn how this is done for the future work with application B). I have two entities in my .edmx, User and Payer.
I also want to use the repository pattern (is this a good choice?) to make a façade between the DAL and the BLL.
My application has functions for GeneratingSchema (filling the schema object with data), GetSchemaContent, GetSchemaInformation, GenerateCDATABlock, WriteToTextFile, MemoryStreamToString, EncryptData and some functions that uses web services, like SendShema, AuthenticateUser, GetAvalibelServises and so on.
I’m not sure where I should put it all?
I think I have to have some Interfaces like IRepository, ISchema (contract for the auto generated schema class, how can I do this?) ICryptoManager, IFileManager and so on, and classes that implements the interfaces.
My DAL will be the Entity framework. And I want a repository façade in my BLL (IRepository, UserRepository, PayerRepository) and classes for management (like the classes I have mention above) holding functions like WriteToFile, EncryptData …..
Is this a good solution (do I need a service layer, all my GUI is in application B) and how can I organize my layers, interfaces, classes an functions in Visual Studio?
Thanks in advance.
This is one heck of a question, thought I might try to chip away at a few parts for you so there's less for the next guy to answer...
For application B (VB6) to call application/assemblies A, I'm going to assume you're exposing the relevant parts of App A as COM Components, using ComVisibleAttributes and similar, much like described in this artcle. I only know of one other way (WCF over COM) but I've never tried it myself.
Splitting your solution(s) into various tiers and layers is a very subjective/debatable topic, and will always come down to a combination of personal preference, business requirements, time available, etc. However, regardless of the depth of your tiers and layers, it is good to understand the how and the why.
To get you started, here's a couple articles:
Wikipedia's general overview on "Multitier Architectures"
MSDN's very own "Building an N-Tier Application in .Net"
Inversion of Control is also a very good pattern to get into right now, with ever increasing (and brilliant!) resources becoming available to the .Net platform, it's definitely worth infesting some time to learn.
Although I haven't explored the full extent of IoC, I do love dependency injection(a type of IoC if I understand correctly though people seem to muddle the IoC/DI terms quite a lot). My personal preference for DI right now is the open source Ninject project, which has plenty of resources online and a reasonable wiki section talking you through the various aspects.
There are many more takes on DI and IoC, so I don't want to even attempt to provide you a comprehensive list for fear of being flamed for missing out somebody's favourite. Just have a search, see which you like the look of and have a play with it. Make sure to try a couple if you have the time.
Again, the Repository Pattern - often complemented well by the Unit of Work Pattern are also great topics to mull over for hours. I've seen a lot of good examples out on the inter-webs, and as many bad examples. My only advice here is to try it for yourself... see what works for you, develop a version of the patterns that suits you best and try to keep things consistent for maintainability.
For organising all these tiers and layers in VS, I recommend trying to keep all your independent tiers/layers in their own Solution Folders (r-click the Solution, Add New Solution Folder), or in some cases (larger projects) there own solutions and preferably an automated build service to update dependent projects with up to date assemblies as required. Again, a broad subject and totally down to personal preference. Just keep an eye out when designing your application for potential upcoming Circular References.
So, I'm afraid that doesn't even slightly answer your question, but hopefully provides you with some resources to check out and a few hours of reading.
Good luck!
I'm a spring newby (been baby sitting an ERP tool for the past 5 years). Anyway, I've got a few of the sample apps (petstore/etc) running, got spring security basics figured out, and am ready to start a new project. My question is, are there any best practices for "breaking apart" the site into different webapps.
For example, the project will have the standard web stuff (/contactus, /about, etc), a user area (/myprofile, etc), and an admin section (/admin/users, etc). Is it generally the practice to roll all of this into one webapp, or I was thinking about possibly removing all of the admin functionality to a separate webapp. Other than being able to keep the admin site running while the other stuff is down for maintenance, is there any reason for breaking apart the project? Any best practices to be observed here?
Any advice would be appreciated.
I would recommend splitting your web application where it makes sense. As you already have mentioned, splitting a web application comes with the (quite huge) benefit that you can have parts of the site running while updating other parts. Other advantages to splitting the web application are:
Quicker development, smaller web applications will be quicker to deploy in a test environment or embedded container.
Easier dependency management, you avoid having a large web application that depends on all your other projects.
You will have a more secure site, there is less risk of information leaking from one application to the other (e.g. admin information leaking to the customer site) than if you have everything in one big application.
...
How to split a web project depends on the project (of course), but try to find areas where you see a clear sepration from the rest of the web application.