Return to site

Visual Designer 4 4 – A Multi Purpose Design Applications

broken image


-->

When you create a model using the Entity Framework Designer your classes and derived context are automatically generated for you. In addition to the default code generation we also provide a number of templates that can be used to customize the code that gets generated. These templates are provided as T4 Text Templates, allowing you to customize the templates if needed.

The code that gets generated by default depends on which version of Visual Studio you create your model in:

  • Models created in Visual Studio 2012 & 2013 will generate simple POCO entity classes and a context that derives from the simplified DbContext.
  • Models created in Visual Studio 2010 will generate entity classes that derive from EntityObject and a context that derives from ObjectContext.

Micro Focus transforms your digital business with enterprise application software across DevOps, Hybrid IT Management, Security and Predictive Analytics. Beginning in 2005, the Army and Marine Corps began a multi-year effort to examine methods to help commanders and staffs understand complex, ill-structured problems and visualize approaches to solve them. Collectively referred to as 'design,' the Army and Marine Corps incorporated design into their respective doctrines by 2010. Best described as a mixture of user interface design and graphic designer, the visual designer is the glue that keeps a project on track. What the Job of Visual Designer Entails The role of a visual designer is a multifaceted position in a company or team member that works in tandem with different designers—i.e. Web designers, user interface.

Note

We recommend switching to the DbContext Generator template once you've added your model.

This page covers the available templates and then provides instructions for adding a template to your model.

Available Templates

The following templates are provided by the Entity Framework team:

DbContext Generator

This template will generate simple POCO entity classes and a context that derives from DbContext using EF6.This is the recommended template unless you have a reason to use one of the other templates listed below.It is also the code generation template you get by default if you are using recent versions of Visual Studio (Visual Studio 2013 onwards):When you create a new model this template is used by default and the T4 files (.tt) are nested under your .edmx file.

Older versions of Visual Studio

  • Visual Studio 2012: To get the EF 6.x DbContextGenerator templates you will need to install the latest Entity Framework Tools for Visual Studio - see the Get Entity Framework page for more information.
  • Visual Studio 2010: The EF 6.x DbContextGenerator templates are not available for Visual Studio 2010.

DbContext Generator for EF 5.x

If you are using an older version of the EntityFramework NuGet package (one with a major version of 5) you will need to use the EF 5.x DbContext Generator template.

If you are using Visual Studio 2013 or 2012 this template is already installed.

If you are using Visual Studio 2010 you will need to select the Online tab when adding the template to download it from Visual Studio Gallery. Alternatively you can install the template directly from Visual Studio Gallery ahead of time. Because the templates are included in later versions of Visual Studio the versions on the gallery can only be installed on Visual Studio 2010.

DbContext Generator for EF 4.x

If you are using an older version of the EntityFramework NuGet package (one with a major version of 4) you will need to use the EF 4.x DbContext Generator template. This can be found in the Online tab when adding the template, or you can install the template directly from Visual Studio Gallery ahead of time.

EntityObject Generator

This template will generate entity classes that derive from EntityObject and a context that derives from ObjectContext.

The DbContext Generator is now the recommended template for new applications. The DbContext Generator takes advantage of the simpler DbContext API. The EntityObject Generator continues to be available to support existing applications.

Visual Studio 2010, 2012 & 2013

You will need to select the Online tab when adding the template to download it from Visual Studio Gallery. Alternatively you can install the template directly from Visual Studio Gallery ahead of time.

Visual Designer 4 4 – A Multi Purpose Design Applications Examples

EntityObject Generator for EF 5.x

If you are using Visual Studio 2012 or 2013 you will need to select the Online tab when adding the template to download it from Visual Studio Gallery. Alternatively you can install the template directly from Visual Studio Gallery ahead of time. Because the templates are included in Visual Studio 2010 the versions on the gallery can only be installed on Visual Studio 2012 & 2013.

If you just want ObjectContext code generation without needing to edit the template you can revert to EntityObject code generation.

If you are using Visual Studio 2010 this template is already installed. If you create a new model in Visual Studio 2010 this template is used by default but the .tt files are not included in your project. If you want to customize the template you will need to add it to your project.

Self-Tracking Entities (STE) Generator

This template will generate Self-Tracking Entity classes and a context that derives from ObjectContext. In an EF application, a context is responsible for tracking changes in the entities. However, in N-Tier scenarios, the context might not be available on the tier that modifies the entities. Self-tracking entities help you track changes in any tier. For more information, see Self-Tracking Entities.

Note

STE Template Not Recommended

We no longer recommend using the STE template in new applications, it continues to be available to support existing applications. Visit the disconnected entities article for other options we recommend for N-Tier scenarios.

Note

There is no EF 6.x version of the STE template.

Note

There is no Visual Studio 2013 version of the STE template.

Visual Studio 2012

If you are using Visual Studio 2012 you will need to select the Online tab when adding the template to download it from Visual Studio Gallery. Alternatively you can install the template directly from Visual Studio Gallery ahead of time. Because the templates are included in Visual Studio 2010 the versions on the gallery can only be installed on Visual Studio 2012.

Visual Studio 2010**

If you are using Visual Studio 2010 this template is already installed.

POCO Entity Generator

This template will generate POCO entity classes and a context that derives from ObjectContext

The DbContext Generator is now the recommended template for generating POCO classes in new applications. The DbContext Generator takes advantage of the new DbContext API and can generate simpler POCO classes. The POCO Entity Generator continues to be available to support existing applications.

Note

There is no EF 5.x or EF 6.x version of the STE template.

Note

There is no Visual Studio 2013 version of the POCO template.

Visual Studio 2012 & Visual Studio 2010

You will need to select the Online tab when adding the template to download it from Visual Studio Gallery. Alternatively you can install the template directly from Visual Studio Gallery ahead of time.

Designer

What are the 'Web Sites' Templates

The 'Web Sites' templates (for example, EF 5.x DbContext Generator for C# Web Sites) are for use in Web Site projects created via File -> New -> Web Site.... These are different from Web Applications, created via File -> New -> Project..., which use the standard templates. We provide separate templates because the item template system in Visual Studio requires them.

Using a Template

To start using a code generation template, right-click an empty spot on the design surface in the EF Designer and select Add Code Generation Item....

If you've already installed the template you want to use (or it was included in Visual Studio), then it will be available under either the Code or Data section from the left menu.

If you don't already have the template installed, select Online from the left menu and search for the template you want.

If you are using Visual Studio 2012, the new .tt files will be nested under the .edmx file.*

Note

For models created in Visual Studio 2012 you will need to delete the templates used for default code generation, otherwise you will have duplicate classes and context generated. The default files are .tt and .context.tt.

If you are using Visual Studio 2010, the tt files are added directly to your project.

In your career as a PCB designer, you will design a lot of different printed circuit boards to accommodate various design technologies that you'll be confronted with. To that end, you will use a plethora of circuit boards with all kinds of different sizes, shapes, and layer counts. How you decide to configure your PCB layers and what you put on each layer will, of course, be dictated by what you're designing. Stripline and microstrip routing will require certain layer stackup configurations but other details like signal integrity, power, and thermal requirements will factor in as well.

The important thing now is to understand how to best to use your PCB design tools so you can create exactly what you need for each layer when setting up your multi-layer designs. We're using Altium Designer to create our circuit board designs, and its versatility gives us lots of flexibility when setting up designs. Here are some key points that you should know when setting up your own multi-layer designs.

Visual Designer 4 4 – A Multi Purpose Design Applications Free

Configuring Each Layer for the Best Use in Your PCB Design

Once you create the board outline shape that you need for your design, you are ready to configure the layers that you'll be working with. To display the layers in a PCB design, Altium Designer provides you with a 'View Configuration' panel. You can open this panel by clicking the 'Panels' button, going to the 'View > Panels > View Configuration' pulldown menu, or by simply hitting a lowercase 'L' shortcut keystroke. The panel will look similar to the picture below.

The Layers & Colors tab in the View Configuration panel in Altium Designer

The View Configuration panel has two tabs on it: 'Layers & Colors' and 'View Options.' You can see these tabs in the picture above, and as you can see, there's a lot there. Even though this board is a simple two-layer design, the layers tab is very deep, so much so that we've chopped it in half to show you all of the content side by side. With this panel, you have the ability to toggle ‘on' or ‘off' the visibility of 'Signal Layers,' 'Component Layers,' 'Mechanical Layers,' and 'Other Layers.' You can also control layer sets and the active layer as well as configure the system colors.

In the picture below, you can see the 'View Options' tab of the view configuration panel. Here you have additional control over general settings and object visibility. You will find all of these controls useful as we begin to create different layers that will be needed for our PCB design.

Visual Designer 4 4 – A Multi Purpose Design Applications Using

The View Options tab of the View Configuration panel

To add layers to the design, you will want to open up the 'Layer Stack Manager' by going to the 'Design' pulldown menu. Our simple two-layer design doesn't have much set up for its board layers, as you can see in the picture below. However, Altium Designer offers us lots of tools in the layer stack manager to make changes with, as you are about to see.

The Layer Stack Manager in Altium Designer

The first thing you'll notice is that across the top left of the layer stack manager, you have buttons to save, load, or configure the layers from a list of preset board layer stacks. To the right of those buttons are more controls to change the units of measurement as well as copy and paste data. Below that is the main window of the layer stack manager where you can add, edit, or delete board layer information.

The main window is separated into columns for the layer name, type of layer, material of the layer, and much more. Each layer has its own row and as you can see, there are rows for metal, dielectric, and solder mask layers. Each row and column form individual cells in the format of a spreadsheet and many of these cells, such as the layer name, can be edited by clicking in the cell and inputting a new value. Some of the cells, like Material, have dropdown menus to select options from when you click in them.

By right-clicking in the main window, you will have a small menu that allows you to add or delete layers. The same commands are also available in buttons below the main window. You also have controls to move layers around in the stack as needed. In the picture below, we have modified the layer stack manager to add some internal signal layers and corresponding dielectric layers along with thickness data for each.

The Layer Stack Manager modified for a 4 layer board

Setting Up Power Plane Layers in Your Multi-Layer Design

Visual Designer 4 4 – A Multi Purpose Design Applications For A

Your PCB designs may also need power and ground plane layers. There are two different ways to do this in Altium Designer. You can either create a copper pour on a signal layer or create a dedicated internal plane layer in the layer stack. To pour copper on a signal layer, use the 'Polygon Pour' command in the 'Place' pulldown menu. This same command can also be found in the main session right mouse button menu, or the taskbar. Once the polygon pour is created you can then associate it with the desired net and change the parameters as needed, as shown in the picture below.

A Polygon Pour in Altium Designer

Altium Designer gives you a lot of control over poured copper. You can name the pours, specify the fill mode, and remove isolated copper. You can also modify pours, split them, or combine them to name a few of the polygon pour editing functions available to you.

The other way of working with power and ground planes requires you to create an internal power plane in the layer stack manager. Again, you will add a new layer in the stack manager, but this time, you will add an 'Internal Plane' layer instead of a signal layer. Internal plane layers also give you the option of specifying the amount of copper that you want to pull back from the board edge. Once we add our new plane layers, we move them around in the stack manager, adjust their thicknesses, and make other changes, as displayed in the image below.

The Layer Stack Manager modified for a 6 layer board

Control Your Layers with Design Rules and Routing Setups

Another method that Altium Designer gives you for working with layers in your PCB design is through the design rules and router setups. By going to the 'Design > Rules' pulldown menu, you can open the 'PCB Rules and Constraints Editor,' as demonstrated in the picture below.

Design Rules setups in Altium Designer

On the left side of the rules editor dialog box, you can see various settings for routing like width, topology, priority, and others. We have selected 'Routing Layers' in the picture above to show you how you can enable or disable which layers are permitted for routing.

You can also control the preferred direction of routing for each layer when using the auto routers in Altium Designer. Go to the 'Route > Auto Route > Setup' pulldown menu to open the 'Routing Strategies' dialog box. Click on the 'Edit Layer Directions' button to open the layer's directions dialog. As you can see below, you can use the drop-down menus to choose which direction you want the routers to use on any of the layers within your design.

Routing direction setups

Depending on your application layer, your PCB can have a vast array of functions. Utilizing layers properly in multi-layer designs can become an immense selling point for yourself as a designer and as an engineer. Thankfully, strong PCB design software can make multi-layer PCB, cross-layer design, ground plane, and any circuit design space you need to work with easy.

By understanding how to work with layer configurations, you will be ready to meet any design challenges that come your way. Whether it's a simple two-layer design or a complicated flex design, Altium Designer is a comprehensive PCB design software that offers layer configuration capabilities and the design power you need in order to get the job done.

Would you like to learn more about how Altium can help you design a DFM-compliant PCB? Talk to an expert at Altium.





broken image