|
Sounds like one of my jobs.
(No .NET; sent me on a bunch of Java courses, yada, yada ... then said we could use .NET after all; so hang in there, I guess).
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
abmv wrote: , would you go for J2EE or the new stuff
You you need to be a bit more specific than that.
In general no I would not use "J2EE" mainly be cause it is 20 years old. So "new stuff" in this context would be more like "pick something that is currently supported."
My focus would be on Spring probably with either Tomcat or JBoss.
abmv wrote: if dot net was not a choice at all
Both technologies have advantage and disadvantages. With more than 10 years of experience in both, Java has a better service oriented eco system so I would normally pick that.
HOWEVER, that only works if you are building/hiring a new group. If you are using an existing group that has experience one of the stacks then you should be using that stack rather than forcing them to use something new.
|
|
|
|
|
A while back I posted questions about this, then walked away. Now I'm considering going back at it again.
The basic idea was to use an enhancement of FileSystemWatcher that I found here (I think it was this one) that solves some issues like multiple events firing for the same file/folder. It works really well and that's not my question.
The big issues I ran into are:
- How to handle multiple versions of the same file being dropped into the watch folder on different PC's at the same time. With latency, I guess I could always take the last file, but it's still a concern.
- How to deal with a file or folder being deleted or edited during a sync. Example, user creates a file/folder, the the sync starts, then as it's syncing, deletes it? or opens it with some app?
I tried to do some file locking as soon as the sync starts, but it's tricky to get the timing right.
The summary of this is, what's the right way to manage files & folders like DropBox does regardless of what's happening to a file or folder?
I'd appreciate some insight.
Thanks
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
dropbox basically tracks and maintains some info--- C:\Users\xxx\AppData\Local\Dropbox\instance1 -- i think they are considering each box running on diff machine as an instance and do it like in a database u lock and win.. u can run process mon and see what happen ....
Caveat Emptor.
"Progress doesn't come from early risers – progress is made by lazy men looking for easier ways to do things." Lazarus Long
|
|
|
|
|
Something like Dokan.Mem, A filesystem Prototype[^]? It's a bit dated tough.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Save 'em all; tack on a time stamp and source code; sort it all out later.
Some are probably more right than others, by the sounds of it.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Gerry Schmitz wrote: Save 'em all; tack on a time stamp and source code; sort it all out later.
Source code?
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
The "source" of the data: IP address; user id; MAC .... stuff like that. Audit trail.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I am trying to design a class for hierarchical data, I have some categories and dynamic number of subcategories for ex:
1.Technology --> C# --> Threading
-->IO
-->Exception
2.Domain --> Finance-->Equity
-->IR
-->Currency
like that multiple categories user can configure and then he will be able to add articles for any of above category. I have multiple thoughts like below codes and having confusion between below designs of classes
Public class Category{
public int Id { get; set;}
public string description { get; set;}
public int ParentCategoryId {get; set;}
}
Public class Category{
public int Id { get; set;}
public string description { get; set;}
public List<Category>SubCategories {get; set;}
}
Public class Category{
public int Id { get; set;}
public string description { get; set;}
public Category Parent {get; set;}
}
|
|
|
|
|
Use a recursive structure.
Public class Category {
public int Id {get;set;}
public int Depth {get;set;}
public Category Parent {get;set;}
public List<Category> Children = new List<Category>();
public bool HasChildren {get{return this.Children.Count > 0;}}
}
Depth 0 is a "root".
Depth 1 has a parent of depth 0
Depth 2 has a parent of depth 1
...
etc.
And the reverse: A child has a parent at depth - 1
Same model as used by "tree views".
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
Other reply answers the specific question but you might want to consider your design rather than how to implement it.
Hierarchical structures tend to be hard to search.
Is it possible that what you really want are entities with properties?
So...
Entity 1: Domain, Finance, Equity
You might even consider making the categories hierarchical but the entities point to them. Since the categories themselves are a much smaller set then complicated searches on them take less time.
|
|
|
|
|
The fact that one can have multiple "views" of a single collections means they can be "easy" to search: by building "secondary" collections / dictionaries of item "references" over the primary collection.
A tree view, as it's base, uses a list view; which is a "flat" structure.
The "nodes" are indented list items. The "collapsing" is controlled by toggling visibility.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
I was suggesting alternatives that should be explored before deciding on a path.
Gerry Schmitz wrote: The fact that one can have multiple "views" of a single collections means they can be "easy" to search: b
Could be. But that depends on actual business needs.
Gerry Schmitz wrote: A tree view,
Just to be clear this is a parent/child structure which could be implemented as a tree.
And searching tree structures based on parent/child structures will be 'slow' in some sense of the word. It is quite possible that the business needs, to which this post is insufficient to describe, might allow for a different structure which would provide better performance, based on the business needs.
|
|
|
|
|
I starting a core 2.2 web API prototype that will feed a WPF application (I can knock a WPF app out rather quickly) so I only need the API and database.
Starting with a SQL Server database which will migrate to Azure if it goes to presentation. I intend to create a web API that serves up JSON data directly from the data table using:
string sResult = JsonConvert.SerializeObject(dtData); This means there are no models required for the select but do I need a model for the insert/update?
I am using a custom DAL (EF will NOT be entertained) that requires parameters so identifying the fields in the json string will be a requirement.
Alternatively should I use a model structure instead of a json string?
Can I also host the web api on Azure.
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
|
|
|
|
|
Mycroft Holmes wrote: Alternatively should I use a model structure instead of a json string?
I would use a model class for consistency and validation purposes, if nothing else. How you hydrate that model really doesn't matter (as far as the utility of the model class goes, at any rate). Additionally, if you ever intend to serve the data in a RESTful format, it will make that transition a lot easier. You should be able to process that model mapping fairly easily in your DAL.
Mycroft Holmes wrote: Can I also host the web api on Azure.
Yep. In fact, you could skip the WebAPI app entirely if you use the Azure CosmosDB, but that's only useful if an object store will serve your needs.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
I was definitely leaning towards the model structure as that is what I am used to. The project needs a purely relational database so SQL Server is always going to be my go to DB.
How do you test and insert/update if you are using a model transport format, mock the model in the method?
Never underestimate the power of human stupidity -
RAH
I'm old. I know stuff - JSOP
modified 5-Mar-19 17:39pm.
|
|
|
|
|
I think it's more important to build a good database mock to evaluate C/U method output for testing purposes, but that point is debatable.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
I have this that I want to create an API for and would like to do so using micro services.
I have people that are part of teams. Each team has a backlog with workitems in it.
I was thinking of creating the following microservices
/Person
GET - Return a list of person
POST - Create a new person
/Person/{PersonId}
GET - Return the person represented by PersonId
PUT - Update person represented by PersonId
DELETE - Delete person represented by PersonId
/Team
GET - Return a list of teams
POST - Create a new team
/Team/{TeamId}
GET - Return team represented by TeamId
PUT - Update team represented by TeamId
DELETE - Delete team represented by TeamId
Would do the same for Backlog and WorkItem.
The question I can't decide is where should the code go that returns the people in a given team? I mean should I have something like /team/12/members with a GET method that return the people in that team? That would make sens, but then, it would mean that the Team service would need access to the Person database, which violate microservice pattern.
Same, where would the code go to add a workitem to a backlog? /backlog/4/workitem with a POST looks reasonable to me..
So what is the normal way to deal with 0 to many relationship in the microservice world?
Any help would be appreciated!
Thanks
|
|
|
|
|
This is the type of thing that I would be tempted to solve using GraphQL.
This space for rent
|
|
|
|
|
"Micro services" are relative; what was "macro" yesterday, is micro today due to increased bandwindth, larger back-ends, and / or better design patterns.
Any service is micro if it is "fast", and doesn't require round-tripping and / or maintain state; regardless of the environment.
"(I) am amazed to see myself here rather than there ... now rather than then".
― Blaise Pascal
|
|
|
|
|
The plus with microservices is that you can express them much as you would in native code. If you need a data structure, implement a data structure.
/TeamMember/{TeamId}
Get
Post
Delete
And so on. Don't start breaking the standard just to take shortcuts.
"Never attribute to malice that which can be explained by stupidity."
- Hanlon's Razor
|
|
|
|
|
microservices.io wrote: How to maintain data consistency?
In order to ensure loose coupling, each service has its own database. Source[^]
(It has a bit more to say on the subject than the one sentence I quoted, so I'd suggest reading it)
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|
|
Basically, I agree with Eddy Vlungen. What I would like to add is that in your example your microservices are too granular. Naturally you should split your microservices by business capabilities, not by entities.
|
|
|
|
|
In all the docs, it's said that Node makes use of non-blocking I/O.
I guess this is not something totally new. All high-performance servers have been using the same. Even on OS level or network level.
What's making Node.js claim this "non-blocking" tag so much?
I was thinking Apache/IIS or any servers meant for high-volume connections, should be using non-blocking I/O. (i.e I/O port completion model for IIS on Windows).
I still believe IIS should be using IOCP internally, but may be only to a limited extent? as the documents say traditional Servers (Apache/IIS) does create 1-to-1 thread for each client.
It's a bit puzzling, why Microsoft did not think about a Node like pure-Single-threaded solution for servers.
Summary of questions:
1. IIS is really a dumb, 1-to-1 thread spawning server for every connected client?
2. Why Microsoft couldnt think of a Node model for web server, when I/O port completion has been so widely used in so many enterprise level network, I/O frameworks?
Full Reset
modified 17-Dec-18 7:38am.
|
|
|
|
|
On the OS level it is not "non blocking IO", but simply threads and fibers.
Eytukan wrote: 1. IIS is really a dumb, 1-to-1 thread spawning server for every connected client? Yes and no. If it is serving a picture, it doesn't need 40 threads for that. IIS also serves applications, which may launch their own threads.
Eytukan wrote: 2. Why Microsoft couldnt think of a Node model for web server, when I/O port completion has been so widely used in so many enterprise level network, I/O frameworks? Node is limited to what JavaScript can do.
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
"If you just follow the bacon Eddy, wherever it leads you, then you won't have to think about politics." -- Some Bell.
|
|
|
|