modularity

Modular web apps

♀尐吖头ヾ 提交于 2019-11-29 19:22:55
I've been looking into OSGi recently and think it looks like a really good idea for modular Java apps. However, I was wondering how OSGi would work in a web application, where you don't just have code to worry about - also HTML, images, CSS, that sort of thing. At work we're building an application which has multiple 'tabs', each tab being one part of the app. I think this could really benefit from taking an OSGi approach - however I'm really not sure what would be the best way to handle all the usual web app resources. I'm not sure whether it makes any difference, but we're using JSF and

Plotting communities with python igraph

好久不见. 提交于 2019-11-29 14:30:30
问题 I have a graph g in python-igraph. I can get a VertexCluster community structure with the following: community = g.community_multilevel() community.membership gives me a list of the group membership of all the vertices in the graph. My question is really simple but I haven't found a python-specific answer on SO. How can I plot the graph with visualization of its community structure? Preferably to PDF, so something like layout = g.layout("kk") plot(g, "graph.pdf", layout=layout) # Community

ReactJS: How can I have a more modular use of prop types & shapes for objects?

隐身守侯 提交于 2019-11-29 12:32:23
问题 I like to explicitly specify all my prop types for every class. React.createClass({ propTypes: { optionalArray: React.PropTypes.array, optionalBool: React.PropTypes.bool, ... This is from reading reusable components: https://facebook.github.io/react/docs/reusable-components.html However, what if I have a very common object that I use in many classes? For example: var MemoryForm = React.createClass({ propTypes: { memory: React.PropTypes.shape({ memoryID: React.PropTypes.number, content: React

How to find unneccesary dependencies in a maven multi-project?

生来就可爱ヽ(ⅴ<●) 提交于 2019-11-29 07:28:47
问题 If you are developing a large evolving multi module maven project it seems inevitable that there are some dependencies given in the poms that are unneccesary, since they are transitively included by other dependencies. For example this happens if you have a module A that originally includes C. Later you refactor and have A depend on a module B which in turn depends on C. If you are not careful enough you'll wind up with both B and C in A's dependency list. But of course you do not need to put

Javascript requirejs in development but compiled in production

倾然丶 夕夏残阳落幕 提交于 2019-11-28 18:25:41
I'm beginning to evaluate javascript module tools like RequireJS for javascript modularization. This seems useful, especially during development, so I don't need to recompile all of the js files into mylib-<version>.js whenever I change one of the dependent files. My app is distributed with both html and javascript files, and in production, I would like to use the compiled version of the javascript file. So in development, my html file might look something like <html> <head> <script data-main="scripts/main" src="scripts/require.js"></script> </head> </html> But in production, I would expect it

Modular web apps

吃可爱长大的小学妹 提交于 2019-11-28 13:40:55
问题 I've been looking into OSGi recently and think it looks like a really good idea for modular Java apps. However, I was wondering how OSGi would work in a web application, where you don't just have code to worry about - also HTML, images, CSS, that sort of thing. At work we're building an application which has multiple 'tabs', each tab being one part of the app. I think this could really benefit from taking an OSGi approach - however I'm really not sure what would be the best way to handle all

What is the best way to manage configuration data

一世执手 提交于 2019-11-28 03:41:50
I am working on a product suite which has 4 products. Right now, all of the configuration data is either in the XML or properties files.This approach is not maintainable as we have to manage different configuration file for different environment(for e.g. Production, Development etc). So, what is the best way to handle configuration data? Also, can we modularize this into a separate module? So that all products can use this module. We don't want to use the property files. I am looking for a solution in which we can move all of the configuration specific code as a new configuration module and

Javascript requirejs in development but compiled in production

让人想犯罪 __ 提交于 2019-11-27 11:19:37
问题 I'm beginning to evaluate javascript module tools like RequireJS for javascript modularization. This seems useful, especially during development, so I don't need to recompile all of the js files into mylib-<version>.js whenever I change one of the dependent files. My app is distributed with both html and javascript files, and in production, I would like to use the compiled version of the javascript file. So in development, my html file might look something like <html> <head> <script data-main

How to use 3rd party library in Java9 module?

不羁的心 提交于 2019-11-27 08:26:05
I have some java9 module that uses 3rd party library that is not Java9 module, just a simple utility jar. However, the compiler complains that it can't find a package from my utility. What should I do in module-info.java to enable usage of my 3rd party library? You can use your library as an automatic module . An automatic module is a module that doesn't have a module descriptor (i.e. module-info.class ). But what name should you use to refer to this module? The name of the automatic module is derived from the JAR name (unless this JAR contains an Automatic-Module-Name attribute). The full

Splitting up shared code and web.xml from WAR project to common JAR project

こ雲淡風輕ζ 提交于 2019-11-27 08:09:41
I have different webapps that share a large portion of the web.xml configuration. For example, the way some servlets are mapped is identical for all apps, but some webapps have custom servlets, or an additional filter, or shared managed beans. Each webapp is a different project in my IDE. I would like to refactor the common part of my web.xml to a "common" project, and let all the application-specific web.xml's extend the "common" web.xml. Is there any possibility to do this? BalusC Yes, you can. Assuming Eclipse (your question history confirms that you're using it), just create a "Web