maven3 multi module child groupId - maven-3

In maven3, I get warnings if I specify the groupId of a child module in a multi-module project to be the same as the parent module. Now I'm not sure if this is indicating that I should use a different groupId or if I should omit it to use the parent groupId.
According to http://maven.apache.org/guides/mini/guide-naming-conventions.html
A good way to determine the granularity of the groupId is to use the project structure. That is, if the current project is a multiple module project, it should append a new identifier to the parent's groupId.
eg. org.apache.maven, org.apache.maven.plugins, org.apache.maven.reporting
That leads me to believe that each child should have a different groupId than the parent. Is that correct?

From the maven documentation
If we want the groupId and / or the version of your modules to be the
same as their parents, you can remove the groupId and / or the version
identity of your module in its POM. This allows the module to inherit
the groupId and / or the version of its parent POM.
The warning is to let the user know this and avoid situations like misspelling groupId or versionId.

Related

What does Create access rights for Attributes do?

I was recently looking at access rights for attributes and seeing if certain attribute properties are controlled by M and others by C, but it seems like I have access to all attribute properties with the M access rights. Does anyone know what Create access rights gives for attributes?
With DOORS' concept of hierarchy and inheritance and with the general concept that everything may have its own access rights, not every single access right makes sense.
C on "something" allows you to create "something else" that is one hierarchy level below the "something". If you have an Object in your Module and remove C on this Object's properties for a group of users these users may not create Objects below this Object (example: Object containing the heading of chapter 2.3. The users will not be allowed to add any Objects in Chapter 2.3).
There is nothing in the DOORS hierarchy below Attribute definitions and Attribute values, so setting or removing C here has no effect.
In the hierarchy, Attribute definitions are directly below the Module. So, in order to prevent that a user creates Attributes on their own, you will have to remove C for this user on the Module, i.e. in the module properties. Unfortunately, this will also disallow that user to create any Object on Level 1, leaving them to being next to unable to edit the module content.
Also, removing C on the module properties will disallow the users to create Views, as View definitions are also placed directly below the Module in the hierarchy.

TFS 2017 Linked Parent Child Query - Filters between different Projects

I have a linked query where Parent is from one Project and linked child Query is from another project. I am able to create filters on project level. But how can i put filters between columns of Parent and linked child work item. Parent and child belong to different project .
example: Parent [WorkItemItem] = Child [WorkItemType]
In short. You can't.
But that answer is too short. So I have to add more so stackOverflow accepts this as an answer.

TFS 2017 Inherit Values from Parent WIT when creating Child

When linking a child WIT to a parent in TFS I'd like to copy values from the parent into a child WIT Template. If the parent WIT has a title of xyz and I'm linking a child WIT and creating a new template for it, I want to grab the parent values from certain fields, mainly title. I think people deciphered my original request but hopefully this is a little cleaner.
No, it's not supported.
Copy rule only available within the work item itself:
You can use the COPY, DEFAULT, and SERVERDEFAULT elements to
copy a value from one field to another, copy a server value into a
field, or specify a default value to be defined for a field.
Source here: Define a default value or copy a value to a field
Parent/Child just links between work items, but no any relationship eachother accross the value of the fileds.

Auto generated values in Grails domain class

Is there a way to add my own auto generated field to domain like id and version , If yes the please guide me . provide me URL form where i can read and under stand the core concept of Grails and Domain specific language .
use install-template in the app to get all default templates:
grails install-template
after which you would be able to see /src/templates (newly created)
Modify DomainClass.groovy under /src/templates/artifacts as below:
#artifact.package#class #artifact.name# {
//according to your need
Long myId
Integer myVersion
static constraints = {
}
}
Done!!!!
Henceforth, when create-domain-class command is used to create a domain class, those fields will be auto populated.
I am not sure I am understanding your question correctly but here is the link to the web features of Grails documentation. The "Link Generation API" may be something you are asking after.
If you would like to manage ID and version than using Spring Security (plugin or full docs) or SQL features may be the direction you want to read more about.
EDIT: Try this Stackoverflow question and answer on using inheritance. Seems to be very similar to what you are asking.
You would need to write an AST transform to inject the fields you want to add automatically. The one that injects ‘id’ and ‘version’ can be found here as an example:
https://github.com/grails/grails-core/blob/master/grails-core/src/main/groovy/org/codehaus/groovy/grails/compiler/injection/DefaultGrailsDomainClassInjector.java
You would then need to write a GORM event listener to automatically update the values of these properties. See
https://github.com/grails/grails-data-mapping/blob/master/grails-datastore-gorm/src/main/groovy/org/grails/datastore/gorm/events/AutoTimestampEventListener.java
For an example of the one that updates the dateCreated/lastUpdated properties.
These can both be written in a separate Gradle/Maven project which you then reference in the dependencies of your BuildConfig.groovy file.

Using repository pattern in ASP.NET MVC with a SQL Server DB; how to mock repository so its unit testable without breaking OOD

I've been learning the ASP.NET MVC framework using the Apress book "Pro ASP.NET MVC Framework" by Steven Sanderson. To that end I have been trying out a few things on a project that I am not that familar with but are things that I thing I should be doing, namely:
Using repository pattern to access my database and populate my domain/business objects.
Use an interface for the repository so it can be mocked in a test project.
Use inversion of control to create my controllers
I have an MVC web app, domain library, test library.
In my database my domain items have an Id represented as an int identity column. In my domain classes the setter is internal so only the repository can set it.
So my quandries/problems are:
Effectively all classes in the domain library can set the Id property, not good for OOP as they should be read-only.
In my test library I create a fake repository. However since it's a different assembly I can't set the Id properties on classes.
What do others do when using a database data store? I imagine that many use an integer Id as unique identifier in the database and would then need to set it the object but not by anything else.
Can't you set your objects' IDs during construction and make them read-only, rather than setting IDs through a setter method?
Or do you need to set the ID at other times. If that's the case, could you explain why?
EDIT:
Would it be possible to divorce the ID and the domain object? Does anything other than the repository need to know the ID?
Remove the ID field from your domain object, and have your repository implementations track object IDs using a private Dictionary. That way anyone can create instances of your domain objects, but they can't do silly things with the IDs.
That way, the IDs of the domain objects are whatever the repository implementation decides they are - they could be ints from a database, urls, or file names.
If someone creates a new domain object outside of the repository and say, tried to save it to your repository, you can look up the ID of the object and save it as appropriate. If the ID isn't there, you can either throw an exception to say you need to create the object using a repository method, or create a new ID for it.
Is there anything that would stop you from using this pattern?
you can use the InternalsVisibleTo attribute. It will allow the types from an assembly to be visible from the tests (provided they are in different assemblies).
Otherwise you can leave the property read-only for the external objects but in the same time have a constructor which has an ID parameter and sets the ID property. Then you can call that constructor.
Hope this helps.

Resources