I have a series of .NET MVC 5 projects I'll be creating that will be used by different departments in my organization with a central index. I'd like to set up a project that contains the css, scripts, images, layouts, error pages, and eventually forms authentication logic/pages. I would then want sub-projects that inherit all of those things so that I don't have to duplicate them for each.
As far as the url structure goes, I'd want to get to the index like this:
www.companyname.com/AppCentral
And to get to one of the sub-projects (TimeKeeping):
www.companyname.com/AppCentral/TimeKeeping/Home
I currently have one project with all of the Controllers/Views/etc for each sub-project lumped in with one another, which can be cluttered. How can I structure my solution so that one project governs css, scripts, images, layouts, error pages, and authentication for sub-projects, so that I may have better separation between projects without having to repeat code/config?
Those structures may have separate solutions, so I numbered them for easier reference. My apologies if this question has been asked a lot, or is often found in references. I was unsure how to find a concept like this using a search engine.
I suppose you searching for areas that appeared in MVC 5.
If you use them you still have all your base logic and styles in the same project but can customize Views, Controller logic and ViewModels.
Related
Is there a way to change the project listing so that sub projects display as nested items below their parent?
I have looked in the documentation and searched here, but cannot find anything.
At present the display of projects is either alphabetical or by creation date and doesn't differentiate between projects and sub projects.
It would be useful to be able to group projects in teh list under their master project.
NOTE: The Subprojects feature is still in development, so stuff might still change over the coming months.
There isn't a built-in way to do what you're asking, but that doesn't mean there isn't a way. For example, I often list the master project in the subproject's name, in brackets. (i.e. "Goldilocks [PawLIB]") This allows me to create and save a Projects query for those projects with "[PawLIB]" in the name.
There are a few other ways to approach the issue, such as strategic use of project icons or colors (queries can search by those).
In short, organize your projects using names, icons, or colors, and then set up a query. This does not nullify the usefulness of the subproject feature - that handles many trickier organization in the background - but the feature as it exists can't do everything.
Aside from that, you could technically request a feature, but I wouldn't recommend it. Developer Chad Little mentioned that the features are backlogged by about two years. All things considered, they have bigger fish to fry.
I'm trying to figure out a way to make Phabricator manage several unrelated products. I installed Phabricator, imported a few source repositories and customized the side menu by adding all the default Phabricator applications (just to get an idea of what Phabricator offers "out of the box").
At first, I liked what I saw, but after spending a bit of time exploring, it started to appear Phabractor is just a collection of various SCM tools that are not linked together. I'm really looking for a set of top level "Products" and under each I can create various related Wiki Pages, Tasks/Bugs, [sub]Projects, Uploaded Files, Legalpad entries, etc.
What I am seeing, for example, is a general Wiki Engine (Phriction) that is no way linked to a Project or a top-most Product. Also, I can create a Legalpad document, but again cannot assign it to a project or product. Same with Files I upload. Even my imported source code repositories are just floating out there without any link to a Project or Product.
Am I missing something? Is anyone using a single instance of Phabricator to manage multiple unrelated products with potentially different groups of end users?
One potential work-around is I could setup a custom Dashboard for each of my products and link in the associated projects, tasks and even links to related wiki pages, but seems like a lot of work for each product and it still seems there is no way to categorize Uploaded Files and Leagalpad.
#Flagrama answers is most of the reality. If you want simple hard separation like you could find in other tools like Redmine, Phabricator is not conceived this way.
Now there is something that could make thing a little more natural: Phabricator Spaces.
It allows to split things pretty neatly. You can see the doc here:
https://secure.phabricator.com/book/phabricator/article/spaces/
In Phabricator you can create a Project. You can set it up so that anybody can join it, or so only administrators can add users. You can also make projects only visible/joinable to members of other projects.
"Visible to Members of Project..." is the basis of managing unrelated projects in Phabricator. Every repository you create, page you add to the Wiki, file you upload, or LegalPad document you create can be set to only be visible to members of a certain project.
Unfortunately I'm pretty sure this is the limit of Projects in Phabricator at present so it may still not meet your needs.
Phabricator is very flexible and includes several different ways to organize your work and your workflows.
Spaces
Another answer already suggested that you could try Spaces, which is a sort of global grouping and that can be used to isolate everything within one space and keep it almost entirely separate from everything that's in another space.
Projects
Phabricator also has a concept of "Project Tags" which you can use to organize tasks, repositories, blog posts and various other "Objects" within the various Phabricator applications. Most objects support one or more tags and the tags are defined by Projects which you create. Tags can be used as free-form labels or you can create a hierarchy of projects and sub-projects.
I'll go into a bit more detail about using Phabricator's Projects feature since that is how I've used Phabricator so that is what I'm familiar with.
Organizing your work with with Projects and Tags
Create a top level project for your tool, product, team or whatever makes sense in your situation.
Tag the repositories, wikis pages, blog posts, tasks, etc which belong to the project created in 1. using the project's #hashtag.
Customize the menus on your project to link to related repositories, wikis, documentation, etc. The project menus are quite flexible, as are other "profile" menus such as dashboards and user favorites menus.
Use the project's workboard to manage tasks related to the project.
Create subprojects, milestones, etc as needed.
6, Repeat 1-5 for each project you work on.
Oke so I am about to make a website using symfony 2.
Should I just make a "main" bundle that controls/puts together all other bundles?
With other bundles I am thinking of lets say a "gallery" bundle that controls things related to photos, and a "store" bundle that controls a shop part.
What would be best (or atleast good) practice and how would professional teams do it?
According to symfony documentation a bundle should be consistent and closed structure. So, if for example "store" and "gallery" are related in some way (eg. use the same model), then they should be in one bundle (AppBundle, CoreBundle, PlatformBundle - whatever you want). But if gallery is completely separate piece of code and can be easily join to another project - then you should consider exclude it to separate bundle.
I think a good idea is look at some projects on github and look how others handle this.
See the following questions and my answers to them:
Should everything really be a bundle in Symfony 2?
Symfony2 conceptual issue: general bundles vs. specific ones
Basically, in my last projects I'm not using bundles for app specific code; the only exception is for stuff that's hardcoded to be in a bundle — like Doctrine Fixtures — that I put in AppBundle. Everything else — models, controllers, services, form types, etc — are out of any bundle.
Like #Cyprian said a bundle is a set of functionality that can work alone. As it happens while developing we do not always know when things are separate. It comes with time.
Personally, I am working with Symfony2 since Febuary and I never stopped reading the manual and related books to understand more in depth. That helped a lot and is very interesting read, I assure you :)
Here is my top favourites documentation pages, en enlightening blog posts on delicious.
For your immediate question, forget about "frontend" and "backend" as we were doing in symfony 1.x. Just think of Model entities (as in A SINGLE row) and build in one bundle. As your code will grow, you will see how to disassemble and separate in bundles. You just have to keep in mind to separate your functionnalities in small methods and refactor around.
I just want to know if anyone stores their helper classes or methods in a separate assembly and why...just for clean management of them? I've seen so many posts about using a helper folder inside your MVC project and that brings me back to the messy old days in ASP.NET where people were using an App_code folder instead of cleanly separating things out physically like this into its own project.
And likewise nobody doing real architecture is going to put models in some folder in your MVC web assembly. They would go in MyApp.DataLayer assembly or MyApp.Models or something like this.
Yes, but for reasons, which are common to other assemblies as well
Becomes easy to plug into any other project.(might need some editions).
Reusable
Easy to improve
Easy to refractor
As not part of a project, but project
itself, it is easy to document and easy for developers to understand
Clears out some of the mess
But for all that above, your assembly, when ready, should be a "job well done", other wise, it is better to keep the helper classes to where they belong.
We have some helpers in a separate project and some in the web project. I think you'll find that some of your helpers need to use abstractions that you've defined in your web project itself. And that will often force you to put those helpers into the web project, because it's not likely desirable to have some other project that has a reference to the web project. I don't consider it the same as using App_Code. These are files that are compiled at compile time inside your IDE, with no special "magic" that gets applied to App_Code.
I use projects to separate out the different layers in my web or form apps. It allows me to respect the business rules better. Also I find it easier to track down where I need to go if I want to make a change.
But I have seen people use folders that label the layers in the solution but I think that is a little messy.
Yes, because they are part of the Business Layer. Two big payoffs:
Reusability
Testability
Keep in mind that your utility functions and helper classes are likely to be some of the most heavily used components of your entire system. Without full BICEP testing, you run a truly unacceptable risk.
Most helpers that I create are usually layer specific so I tend to keep them with the assembly the base assembly that needs them. I don't see a reason to add in another project to store a large number of specific helper classes.
I have the need to build lots of sites that are very similar, but not exactly the same, using ASP.NET 2.0.
I'm trying to find the best way to make generating these sites quick and easy.
The sites will be used to collect information about a user, and there will be multiple steps for each site.
The sites will all collect similar information, but some sites may require less or more information than others. Additionally, certain form fields will need to be populated from different database tables, based on the site.
I would like to use a Microsoft patterns & practices solution, but I'm not sure that there is one that fits this scenario.
My current thinking is that I will put as much business logic as possible into an external assembly and then write a custom Web user control for each step for each site. I will include these user controls in a master page's Panel control.
I don't like this solution because each site will be nearly duplicating the code for the other sites.
How can I improve upon this design?
The main obstacle is that the sites are similar, but sufficiently different.
Thanks!
Alex
you can create base classes which handle all of the common functionality and then have your site specific controls inherit from their respective base classes and then implement their specific implementations.
We face this problem all the time. What we do is to have a common library that all our sites use, and to bury shared functionality in classes or utility modules in this library. Each site can then use those objects or utility functions as is, or extend the common classes. Keep in mind that these shared classes can include all kinds of things, including code-behind for pages and user controls that you can inherit from and extend.
Deciding what goes in the app and what goes in the common library is one of the hardest things about our business, though. Put it in the common library and you lose flexibility; put it in the app and you risk having duplicate code to maintain.
If you have a fairly complex database setup, it might be worth your time to come up with a framework for specifying your db schema in XML and having your app enforce that schema and build any additional SQL infrastructure that you need based on that definition (e.g. utility views, stored procedures, etc). We did this and it resulted in a huge productivity boost.
Have you looked into Monorail (www.castleproject.org) this is an implementation of themvc pattern, similar to Ruby on rails with a few nice view engines, I prefer Nvelocity.
from castle project as well you can use n implementation of ActiveRecord that makes life real nice. if you are on that trail also have a look at coln ramsay screencasts .
To be honest all ms solutions are real fat
another great thing about the castleproject is that is totally open source so you can learn loads from their code
How about using an Application Framework like DotNetNuke or mojoportal?
They both provide flexibility and enable you to develop websites very quickly with common functionality. Leaving you to develop custom modules where the functionality you require may be different. There are also thousands of other modules that can be bought which provide excellent functionality.
However we chose to use WCSF and enhanced upon it.
All the above mentioned projects are open source and some good examples of code to learn from.
I know it may be a late answer but I hope it helps