How to create a good structure for a multi-brand project on vue.js?

I want to create a multi-brand Vue.js project. There will be common components, but there will be also exceptions. I want to find a good structure for that issue.

All brands will use the same routes. After doing an API call (or based on domain) we will determine the brand. Based on that brand we need to import/show only required and relevant components/files.

I though to use a similar structure to Magento. Based on the brand we can check if a file exists in brand’s folder, if doesn’t we can use the default file. So, we can create default components, but also create exceptions grouped by folders with brand name. I think it is not possible to access the file system to check if a file exists or not (out of public folder). This is the problem.

What would be the best way to do that?

Is it a “Natural language” form a good practice?

A good UX for a form is one that makes it easy and fast to use. An experimental form like this, that uses natural language instead of the usual form display seems to be simple to use and creative, but is this enough intuitive?

enter image description here enter image description here

Update:

After I did more research on this UI pattern called “natural language form”, a saw this article by Luke Wroblewski, ““Mad Libs” Style Form Increased Conversion by 25-40%”. He talks about a “‘Mad Libs’ Style Form” that presented input fields to people as blanks within sentences, in a natural language and publish this conclusion:

Ron and his team ran some A/B testing online that compared a traditional Web form layout with a narrative “Mad Libs” format. In Vast.com’s testing, Mad Libs style forms increased conversion across the board by 25-40%.

What do you think about natural language user interface (NLUI) for a form? This innovative design help users to complete the data in a fun, easy way or it is not intuitive and what they expect?

What is a good method/practice I can employ to keep identical code snippits in two places in sync? Also, help documenting functionals

If I could get some input on the design of this, I would be grateful as well.

Note that I’m programming in python.

There’s a function F that takes lots of data, runs some analysis on it (taking maybe a minute or more) to compute some crucial fruits theta, and then spits out a function g(x), that has a lot of functionality that it can do efficiently solely by accessing theta, the fruits of analyzing the data.

Now one might wish to save this g function. So I designed the following functionality

theta = g(mode="get theta") # gets the `theta` value that `g` was using # perhaps store `theta` as a pickle file, or a json file, whatever # read `theta` from its storage restored_g = restore_g(theta) # restore_g is a function that                                # takes a `theta` and gives you                                # a `g` that runs based off that                                # `theta` 

If you want a concrete example to think about, think interploation. F gets a bunch of data points, and after processing, spits out an interpolation function g. You can’t save a function though, so you save the theta that g was using, and then you can theoretically restore the interpolator later on with a restore_g function using that saved theta.

The thing is, though, that the code for F and restore_g will look like this

def F(data):   theta = do_tons_of_processing(data)   def g(args):     return do_stuff(args, theta)   return g  def restore_g(theta):   def g(args):     return do_stuff(args, theta)   return g 

The problem here is that

def g(args):   return do_stuff(args, theta) 

appears twice, exactly the same, seemingly by necessity. I can’t think of a way around editing that snippet of code in both places whenever I want to make a change to g, like what arguments it takes, the description of what it does, etc. How can I best address this?

Two more related questions I have are: what is the best practice for describing the functions?

Normally, one would do something like

def f(x):   """concise description    longer description    inputs   ------   x : int     what the input means    returns   -------   y : float     what the return value is    maybe some examples   """   return 0.2*x 

But my F and restore_g themselves return a function g, whose inputs and outputs should also be described. So where should this description happen? And how can it be maximally synced between F and restore_g with minimal redundancy?

Finally, what is the “best” (or at least, a good) practice for going about g having multiple orthogonal purposes? Sometimes, it might take an x and a y array as arguments to spit out something. Sometimes it could just take an x value to spit out something. And sometimes, it’ll take "get theta" so it knows to spit out theta. Is it considered inappropriate to just overload the x argument so that if it’s fed "get theta" (or some other keyword), then g will follow the “get theta” functionality? Is it better to create a whole other argument called mode or some such that can be set to "get theta" or what have you?

Are there any good web apps for Twitter for Businesses? [closed]

I’m looking for the best Twitter-based web app that can be used by a fairly high-profile business.

I’d prefer to use a web app rather than a client app because it may need to be managed from various places.

It needs to be able to manage (tweet from) multiple Twitter accounts (company and individuals), keep track of a number of searches, and have an easy-to-use UI for non technophiles.

Any suggestions?

Is defining a Service like this a good idea? MVC architecture [on hold]

This intends to represent a base service interface for services that act as an API for an Entity related operations.

  • T -> the Entity class type

  • ID -> the Entity Id class type

  • DTO -> the Entity Dto representation

Java code:

public interface BaseService<T, ID, DTO> {    T create(DTO dto) throws Exception;    List<T> findAll();    T findById(ID id) throws NotFoundException;    T toEntity(DTO dto);    DTO toDto(T entity); }